if you weren't born yesterday, you've done some shit you wish you didn't.
particularly for those of us with obsessive tendencies, it's easy to ruminate on past mistakes you've made in your life, digging yourself deeper and deeper into some mental pit.
why didn't I do x when I should have done y ? I'm a fucking idiot, you say to yourself.
I know. I've been there. I've done things I look back on, and honestly, I just want to punch myself in the face. Treated people who loved me like shit, the works. Somewhere, somebody is telling somebody else a story, and then their friend says what a fucking douchebag.
I am that guy, and so are you. We all are.
the problem with this mental feedback loop is that it doesn't stop, and if you let it, it's going to eat at you from the inside. When you look back at that critical moment, telling yourself that you should have done otherwise, that it was completely your fault - you are hurting yourself. You are refracting all the hatred and anger about the past back onto yourself, like a prism focusing light onto a single point.
here is how you stop hating yourself: you realize that you are wrong. that you couldn't have done otherwise. that you do not have free will. regret is a form of hatred against yourself, but it's not even wrong.
you are a puppet made out of meat, and the laws of physics are the strings.
when you realize that regret doesn't even make sense - do you regret digestion? do you regret your reflexes? do you regret the rain? - that's when you become to let go of the guilt you have, and focus purely on becoming a better person, and making better decisions going forward.
if you're not versed in philosophy, check out Daniel Miessler's excellent introductory posts on free will:
Other related works I recommend:
people I admire
Bret Easton Ellis