Sometimes, the hardest thing to do is to treat ourselves with the kindness, compassion, and love with which we treat others. We beat ourselves up over small mistakes, miscalculations, or missteps that we would never begrudge another for committing. For many of us, when we realize that we have been hard on ourselves, we are hard on ourselves for being hard on ourselves. Thus, we find ourselves in a vicious cycle of self-degradation. If anyone else then validates our self-criticism, we become even more convinced of our terribleness and continue to chastise ourselves with increased vigor. As you might have guessed, this can make us feel terrible and can even lead to depression, anxiety, or other mental health concerns.
One of the tenants I teach in my therapy practice is to be compassionate with yourself the way you would be compassionate with others. As a daily tool, I advise to think about what you would tell a loved one, particularly a child. Then, I encourage you to talk to yourself in this same loving yet encouraging way. Many people, myself included, struggle to do this on a regular basis or even at all. In fact, I face a lot of resistance from people who believe that being kind to themselves will lead to laziness or lack of performance. This is just untrue. You can be kind to yourself while also offering a different action. As a general script, you could try, "You did ____, and that is okay. Next time try ___."
Building the muscle of self-compassion is challenging and often benefits from daily practice. One of my favorite mindfulness meditations is focused on loving-kindness for others but also for yourself. It can be found here. Daily practice can train your brain to be more likely to go to kindness when you make a mistake. This, in turn, may protect you from a vicious cycle of self-criticism.