I've had experiences with malicious people, and the best thing you can do for your own health but also for others, is to recognize that they are unlucky. You already know how bad these people made you feel, you know how bad the effect their actions/words had on your life. So you must know, that if you were to do what they did, you would be filled with disgust at yourself, right? This should be obvious. Just consider, what is their mind like for them to act that way? Are they someone who is secure, or are they someone who needs to put others down to feel good about themselves? (sadist) Or, are they someone who just lacks any capacity to care about others, because they are so self-absorbed? (callous egomaniac) In either case, what if someone offered you a drug to turn you into such a person? Would you take the drug? I'm again going to assume you would say no. That would be a horrible idea, right? You don't want to be like them, you don't want to do what they did. If someone forced you to take that drug, that would be seen as a punishment. You would be unlucky, to become such a person.
From here, you can see that their life, the life they were born into, which would slowly transform them into a bad person, from conditions like: 1) Where they were born 2) What parents/peers/upbringing they had, 3) What genes they had, 4) What events in life they had, all these things, would transform them into this unfortunate person who would cause others misery. Notice how they don't control any of this, they didn't pick this. They were thrown into that life helplessly just like all of us are thrown into our lives helplessly, just like a tiger is thrown into a Tiger's life helplessly. If you were a Tiger, you would do tiger things, including sometimes harming people. If you were a bully, you would bully people helplessly-- that's just what they do.
Aren't they just unlucky? They are a victim, just like the victims they harm. What if this person was you, wouldn't you say you would be unlucky to be them? Now imagine another drug: Imagine we had a cure to their bad luck. Imagine this drug, once they took it, would cause them to suddenly turn into a person who could process shame, and guilt, and regret, and had good intentions towards others. The drug acted instantly, and the moment they were exposed to it, they fell to their knees and started sobbing. They would beg you for forgiveness because the shame would be that intense in the first few minutes, and after those first moments, things would calm down and they would be motivated to try to be better in the future and make up for what they did.
Again imagine this unlucky person is you. Imagine we have the cure-- and we can give it to you, should we do it? It will save the future victims you would prey on, but it would also save you, who is just another victim of bad luck, stuck inside the consciousness of a monster. Would you say thank you to someone who gave you the antidote? They would be a hero for you and others, no?
But... what if someone were to take revenge on you for the bad things you did, would that be good? What if they took revenge, by saying: "Fuck you, I'm not giving you the cure, to punish you for being such a bad person" <-- Would that make sense? Or would that just be more bad intention, the same kind of attitude the bad people have?
The point of all of this, is when you see people who hurt you are simply unlucky, the attitude changes based on what is true, based on a clear examination of what the facts are. Revenge no longer makes sense because for revenge to make sense, you must assume that this person could be different. But they can't-- they are just unlucky, and they are just a victim. Once you see that, you can feel sorry for them. And feeling sorry for them, versus hating them, means hatred does not eat you alive. Because the hatred that you feel , that fuels your revenge? That is like an infection from the hatred of the person who hurt you-- and who hurt them, to turn them into the monster they are. It lived in them, and then it went into you, to poison you for as long as you hold this hatred in you. Once you overcome this hatred, you are free, and you win.