I can recall the first time I learned the little voice in my head was not unique to me. That, in fact, every one of us has an ongoing dialog with ourselves.
Good to know I wasn't the only one talking to myself.
And I was also relieved to learn I was not alone in that voice constantly scolding me. "You f*cking idiot!" was, and still is, a fairly constant refrain inside my head.
Lately, I have been arguing with myself to tone down the harsh rhetoric and be a bit kinder. I know it sounds stupid but, honest to goodness, when I give myself permission to speak a bit softer, to allow my little voice a bit more kindness I feel better.
Encouragement rather than punishing words seems to be more constructive both when they are verbalized to others and internalized in my head.
It just takes practice.