You’re always going to make mistakes. The question is: what are you going to do after you notice them?
When beating yourself up over past mistakes, remember that the reason you’re beating yourself up is because you’re a good person. If you weren’t good, you wouldn’t care. And the fact that you want to do better, means that you probably will do better.
You can’t change the past, but you can change the future. You can be better than you were.
You’ll never be perfect though. No one is. You’ll have to forgive yourself over and over again.