Bad things happen to good people. (They also happen to bad people, and they're not so glad about it either, by the way.) You might have had an unhappy childhood. Maybe your parents never loved you enough. Maybe you fell for a douche and got your heart broken. Yes, people can be assholes sometimes. Even worse, sometimes things happen by chance, unfortunate events and accidents, and you have noone to blame but some vague concept like fate.
Things like that can really slow down our life or even make it pause completely. Suddenly all you can think is about this one bad thing that happened to you. You're not able to trust anyone anmore, you're sad, you pity yourself and you're afraid to live your life. Well none of this is gonna help you in any way. Just because something unfair happened to you, doesn't mean that you have a right to waste your life. Because you will never get those years back.
The only thing which will save your life, is to let it go. I know, this is easier said than done. Sometimes I do little rituals like burning a letter or writing in my diary or telling myself, once I blow out this candle I'll let it go. This might seem fake, but whatever helps you smoothen the process works.
The thing to do is whenever you think about the thing which keeps you from moving forward, realize that you're thinking about it, then consiously think about something different, like what food you're going to eat later or who's your favorite Friends character. I know things like that might sound trivial compared to your life-shattering experience, but sometimes you have to stay shallow in order to not drown in deep water. In the beginning you will feel like cheating, because you distract yourself, but one day the distraction will not be so obvious anymore, and you will slowly let it go.
I do this every night. When I'm lying in bed trying to fall asleep, I often drift away to every single bad thing that ever happened to me and I get caught in a depressing spirale. But once I realize I'm stuck, I tell myself: enough about this, let's make up a story in my head about adventures and magic.
For me, even worse that things other people or life itself did to me, are the things I did. You might have been a major asshole when you were younger and drove away some great friends and lovers. You might have hurt people. Also, we all mess up constantly. Maybe we screwed up at work, maybe we cheated, maybe we typed in our code wrong at the ATM machine and now our card is blocked. No matter if it's something big or small, when we make mistakes it really brings us down.
If there's something you can do to make the situation better, do it. Apologize. It won't make it go away but not apologizing will make it even worse. But at some point you have to let it go. It happened. You can't take it back. So, you screwed up. Well, people aren't perfect. We all make mistakes. Just like you might have to forgive someone who did you wrong for the sake of your own happyness, you have to learn to forgive yourself.
Forgive yourself, let it go and move on with your life. Don't waste anymore time on the past. Put your energy into creating a better future instead.