Well... one way... perhaps the obvious way... is to see a therapist. (You probably didn't need me to tell you that.)

(I will just mention, by the way, that I'm something of an expert when it comes to shame in that I've have a boatload of it I carry around 24 / 7.)
The thing is, at least from my perspective, there's no way to block it or put a stop to it. It just is what it is. Of course, the first thing to do is to figure out a way to change your behavior & stop doing whatever it is you've been doing.

But beyond that, what is most beneficial for me is to employ a practice called "compassionate abiding". Here's a link to a description of the practice:
https://mindsetdoc.wordpress.com/201...e-abiding-101/
And then, beyond that, here are links to some articles from PsychCentral's archives on the subject of how to heal from guilt & shame:
https://psychcentral.com/blog/5-tips...ng-with-guilt/
https://psychcentral.com/blog/shame-...ave-it-behind/
https://psychcentral.com/lib/breakin...tive-behavior/
https://psychcentral.com/blog/stop-b...oming-remorse/
https://psychcentral.com/blog/mindfu...ng-with-shame/