It's like setting a physical injury, but significantly harder because usually you're not dealing with it at the time of injury, only much later.
You find the original source, some event or series of events that caused the psyche to fracture. By fracture I mean caused the mind to operate according to some models that were necessary to survive at the time of crisis, but are no longer adaptive in the normal/real/adult world. You then update your mental model to one that is more aligned with reality.
In other words: go to the source of the pain, unlearn whatever lesson you learned at the time to deal with the situation, learn a different/healthier way of looking at it, and then practice a lot until the new mental model is firmly in place.
This is hard. But it gets easier with practice. And it's much easier than trying to set an injury by taking lots of pain-killers.