Here is a three step process to completely eliminate self-pity.
Step One - Self-Pity is a judgment, not a feeling, call it by it's real name.
That persistent sensation is not "self-pity" it's something like 'sadness' or 'grief' or 'loss'. Use a feeling word list, like the one below, to find out what precisely what the 'something' is. Say some of the words out loud while the feeling is going on. When you get closer to the right word, you will feel a bit of flutter in the "self-pity" feeling. Ask yourself at in that moment, "Is this exactly right? Is it exactly 'wounded'? Maybe you get a sense that 'wounded' almost right, so keep trying with similar words "cut?" "hurt?" "slapped down?" "stabbed?" Maybe the feeling goes crazy at "stabbed." This is its current name.
The next time the feeling arises instead of saying "stop with the self pity!" (or whatever) say to yourself "I feel stabbed right now" or simply "stabbed". Then go about your business. The first step to changing a feeling is acknowledging it.
Step Two - Find out what that feeling knows about the current situation.
If you're busy, naming the feeling is all you have to do. If you have a couple free minutes though, sit quietly and ask 'what is it about this current situation that makes me 'stabbed'? Notice that your mind answers right away. Thank that part for sharing and check if the feeling flutters or changes like it did when you found its name. Chances are it doesn't. As it turns out, the body is a slow, deliberate communicator, while the mind is quick to offer its assumptions and advice.
The thing is, if your mind had the information your body wouldn't be bothering you with the feeling. So wait for something to bubble up from the feeling. Maybe after a few minutes your attention is drawn to one of the individuals in your current situation, John. Ask the feeling, 'Does 'stabbed' have something to do with John?" If you get a change in the sensation, then John it is. Thank the feeling for giving you more information.
Notice at this point how the mind wants to rush in with theories and conclusions. "Do you think John is going to stab me? That's ridiculous!" There is an ever so slight change that John is carrying a knife, in which case the feeling will go crazy (Listen to it!). More likely your body is noticing some connection between the events that you feel self-pity about and your current situation that you have missed. It's a bit like a game of Hot-and-Cold sometimes. You already know that flutter is "getting warmer." You can ask your body for a "getting colder" signal as well.
It's ok to not know what it is about John and stabbed. The next time the feeling comes up there may be more information that will help the body deliver more of its insight to you. Trust this: when the message is delivered you will feel an instant often overwhelming relief. The thing you once called "self-pity' will evaporate.
Here's how it works. Have you ever forgotten something but you don't know what it is? Maybe you're on the way to work and you feel uncomfortable, restless, fidgety. Maybe you go back to look for whatever it is. You find things you indeed forgot, but the feeling lets you know there's still something else.
Now you're at work and the uncomfortable feeling is coming and going. You're getting ready to go out to have a smoke. Suddenly you remember your grandfather's zippo lighter lying on the bathroom sink. You were going to show it to that girl! That's what you forgot. At that moment the feeling that's been haunting you is replaced with relief. You still don't have the lighter, do you? So the feeling is about fixing the problem. It's about delivering the information. If you do step two enough your "self-pity" will transform into relief.
Step three: Self pity is not a behavior.
Whatever behavior you do when you have the stabbed feeling, use self-compassion to be very brave and do something else instead. If the behavior is to talk about the past, notice how brave you are when you talk about something else instead. Buy yourself a cup of tea and a cookie afterward, you earned it.