I’ve never gone through this exactly but have had stints of prolonged pain. I really hate painkillers. I try to meditate. I try to remove my self from the pain and see it externally. Not make it disappear, just see it as separate from myself. And I try to focus on the temporary nature of it. It will pass. In time, I won’t even remember how intense it was. The memory will be there, but not the detail.