You've put your finger on a very important issue -- because our thoughts influence everything we do. Evil thoughts give birth to evil actions -- just as good thoughts give birth to good actions. Before we do something, we must first think about doing it.
The first step is to realize that the bad thoughts you're having are wrong -- not just in your eyes, but in God's eyes. No matter what's happened to us, God doesn't want us to be consumed with anger, hatred and bitterness. These hurt us far more than they hurt the other person -- so why should we let them control us? Instead, turn to God and ask Him to forgive you and cleanse you, and then ask Jesus Christ to take control of your life -- including your mind.
Then ask God to help you fill your mind with good things. The more your mind is filled with good thoughts, the less room there will be for evil thoughts. The Bible says, "Whatever is true, whatever is noble, whatever is right, whatever is pure, whatever is lovely, whatever is admirable -- if anything is excellent or praiseworthy -- think about such things" (Philippians 4:8).
The place to start is with God's Word, the Bible. Make it part of your life every day, and turn your mind and heart to God in prayer when evil thoughts threaten to take over. Most of all, ask God to help you forgive those who have hurt you -- just as He forgives you.