Much has been written about guilt and shame over the centuries, and especially of late there are people doing really great work to unpack, explain, and help us all move past our negative self talk, internal critic/judges, etc., and form new and better relationships, to ourselves and to others. People like Brené Brown are tackling this murky area of the human psyche and I think doing some real good. So my comments may come off a bit flippant or at least off-the-cuff by comparison. That said…
One of the things that strikes me most about guilt and shame are how often they fail to achieve their apparent aim (or at least the goal we attribute to them), which generally seems to be to prevent you from doing something that society, family, or other environmental influences have convinced you are “bad”. Both emotions are almost always felt in the past-tense, about something you did, or a thought you already had. They are attempts by your mind to put some negative cost onto something you’ve already done so as to hopefully prevent you doing it in the future, knowing that there will be this same cost. The problem is it seldom works. For some things (and some people) it is reasonably effective, but many - if not most - people continue to do things that make them feel guilt or shame quite frequently, perhaps multiple times a day.
In reality, what tends to work much better is to ground in reality and begin with acceptance. Recognize the futility of condemning, judging, or otherwise rejecting your past actions, thoughts, reactions, etc. You can’t change them now, and feeling bad about them often won’t prevent similar things in the future.
Since you can’t change what happened, it makes sense to first simply recognize and acknowledge that they happened, that you did, said, or thought these things. Lying about it to yourself helps no one. But try to avoid judgment. This is just about acceptance.
Then, the most important part (in my view), is to get curious about both the action itself, and the negative feelings that came up in reaction to it. Try to understand why you did it in the first place, especially if it’s something you tend to repeat. When did you first start doing this, are there environmental factors that make you more likely to do so, are their social influences making it harder to stop, etc. Then look at the reaction you had to your action: can you find the roots of your guilt/shame? Do you know why you feel it in reaction to your behavior in this case? Can you remember when you first started feeling this way? Are there particular images or memories associated either with the action itself, or the judgmental reaction within you?
Once you gain some understanding of why this negative cycle continues, it can help you feel less judgmental, to react less reflexively with negative self talk. This in itself can help to loosen the circular nature of the pattern and bring more space to understand it further, or even to begin to dismantle it. Often you will struggle to find the reasons if you try to aim directly at it, but the willingness to do so and the curiosity around it can bring insight in time and with persistence. Treating yourself with less judgment and more curiosity in general is a worthwhile practice, even without these specific aims.
Unconditional acceptance of the reality of your past actions combined with deep curiosity can release the binds and help to move past things that guilt and shame can never budge. I don’t pretend any of this is easy, but it can start as small as you need it to. It’s still valuable. The next time you have a negative thought about self, notice it. See if you can just be aware of when it happens. Practice just that. Then, like a scientist, ask yourself one question about the situation. Don’t worry too much about answering it just yet, but try at least to ask it, to think of what you might want to know about what is happening in these moments. Build on this, have patience, and try to be kind to yourself.