I don't know about the person you were replying to, but for me I talk to myself constantly (in my head, not out loud) and it is usually critical/cruel things that I direct toward myself. The more stressed I am the worse it gets. It can be anywhere from me asking myself "Are you kidding me? Why did you do that?" to "Oh my god you worthless bitch look what you have done again."
On top of that I do literally harm myself regularly, worse when I am stressed badly, but I am always in a state of stress somewhat. I bite my fingers, and unfortunately have recently picked up a new habit of biting tiny pieces of my tongue off, especially when I am asleep. I have been wondering for weeks why I keep waking up with sores on my tongue until I literally woke myself up in pain from doing it, and now it is happening all the time, even when I am awake. Also, when I disappoint someone or make them mad at me by mistake (like saying something insensitive on accident) it takes everything within my being to keep myself from slamming my head against something or biting my knuckles until they bleed. Sometimes I slip up and it happens, and then I get even more mad at myself for slipping up.
To OP, at least when it comes to literal self destructive behavior, like what I described above, I have to block everything out and focus on not hurting myself. It means shutting down entirely, breathing, and forcing myself to take a minute or so in silence. Usually if I can push past the first 30 seconds of the impulse, it will pass, and if not another minute will usually help. Trying to practice mindfulness and being self-aware is the only way I have been able to somewhat curb my self-destructive behavior, not just when it comes to self harm but also with intrusive thoughts and putting myself down.
No idea how to stop destructive anxious habits, though. Whenever I get a handle on one, another pops up and it's usually worse than the last. I suspect it might be some undiagnosed something or other but you'd have to drag me to a mental hospital to get me looked at by a doctor lol.