If you make a mistake, do not perseverate on it.
Instead, think about it carefully so you fully understand what you did wrong, then think about how to prevent it from happening again. Let the bad feeling you have cement the lesson in your mind.
Then move the fuck on.
You’re not doing anyone a favor by beating yourself up and brooding on it. Here’s a very hard lesson it took me a long time to learn: there is no shame in making a mistake and learning from it. The shame is in making the same mistake twice.