If the pain is lived through in the present, the karma which provokes the pain will be cleansed. It is pointless to avoid the pain; it is best to live through it, and accept it, so that it does not need to be experienced again.
When judgement is erased, acceptance is more evident and instead of viewing pain as something negative, simply look at it as an event that happens; live through it, and then it is over. Once this is done, you will open doors to experience joy.
Refusing to experience pain blocks the flow of energy and attracts suffering. Karmic pain does not end without this preocess, because it is caused by an emotional blockage.