The first step to forgiveness is compassion. Pain is not created in a vacuum. Aim to understand how someone’s ignorance or dysfunction drove them to do something that caused so much pain. You’re not excusing it or justifying it, just understanding. Challenge yourself to empathize with the other person’s worst suffering and accept them in spite of it. It will help you better understand the suffering which was placed onto you.
The second step to forgiveness is separation. Separate the person’s actions from their humanity. Understand that what they did was merely a faulty strategy to meet their own emotional needs. Their needs are like yours and mine. The way they went about meeting them was not. They have hurt and have suffered injustices as well.
The third step to forgiveness is acceptance. The transgression is a permanent part of you. You can choose to learn from it and become a better person, or you can hold on to it and let it drag you down for the rest of your life. Channel the pain into progress, something positive, something beautiful. Some of the world’s most beautiful art and greatest achievements were borne out of the worst suffering and injustice. Become a conduit and transform pain. This will allow you to become grateful for the experience which hurt you.
The caveat to forgiveness is to not forget.
And for those rare deeds which are unforgivable: sit with them, cease to see the separateness, and let them dissipate in the waves.