Why Beat Yourself Up? 

After a mistake, we have the instinct to be negative.
Justified in beating ourselves up for it.
Like a training to avoid the fate in the future.

This doesn’t work.
It only increases anxiety and self loathing that gets in the way of work.
Another approach is to focus exclusively on what you’re going to do now.
Never attach any emotion to the past.
Look at it coldly to learn.
But live purely in the present.
The tranquility and fulfillment that you seek is reached from doing the right action NOW.
Part of the right action is to focus on the present task.
Not delving in bouts of shame from the past.