This can be a really tough thing. I struggled with self-forgiveness for a long time because I did lots of awful things when I was drinking that I really regret and I spent a long time dealing with shame and regret about the past. But I gradually learned that staying stuck going over the past was keeping me stuck and that I had to focus on the present and the future. I came to the realization that what I'd done in the past was the result of my being sick and that now that I'm sober I can act differently. And it's that acting differently that helps keep me going now.
Some of the books that helped me are John Bradshaw "Healing the Shame that Binds You" and Gerner "The Mindful Guide to Self Compassion" and Neff " The Mindful Self Compassion Workbook"
I will say this wasn't a fast mind change for me, it took me a couple of years of really working on it to learn to forgive and like myself.
But it is possible.
__________________
"I danced in the morning when the world was begun. I danced in the moon and the stars and the sun". From my favourite hymn.
"If you see the wonder in a fairy tale, you can take the future even if you fail." Abba