The skill of self-compassion.
If our friend was going through what we are going through, we would not use the same words, voice or tone with her that we end up using with ourselves.
While engaging with others, especially our friends, we are patient, compassionate and understanding. We give them space. We allow them to make mistakes without judging them or condemning them.
But, when it comes to ourselves, the default is to not treat ourselves well.
However, the default can be changed with practice.
We can learn to be compassionate with ourselves. We can ask ourselves, every time the harsh voice speaks up, "Would I say this to my friend?"
The more we practice, the better we will get at it.
It's difficult to think of a more important skill to practice.