Here is a simple visualization for relieving pain.This technique can heal underlying problems, however, it may just relieve the pain, without affecting the cause of pain. Therefore, just as with pain medications, be sure you know the cause of the pain. Pain is a warning that something is wrong. If you just get rid of the pain you could end up a lot worse off.
That said, for pain relief, try this visualization:
First get into a very comfortable position. Become aware of your breath. Just notice the movement of your breath, in and out, for a minute or so. Then move your awareness to the site of pain in your body. Just notice it; its size and shape, its qualities. Then imagine, if you could see it, what it would look like. What color is it? Is it a red ball, a black, amorphous blob, a greenish pointy thing? Visualize it as vividly as you can, and get very familiar with it.
Next, find a pathway out of your body for it. For instance, if it is in your shoulder, it could move to your elbow, wrist, finger, then out. Or if it is in your stomach, it could move to your pelvis, then down one leg to the knee, ankle, toe, and out.
Now that it is outside of your body, look around for some place where it it my stay. For instance, if it is a red ball, and you can see a traffic light, send it there. If it is an amorphous blob, send it to the corner of a room, where the dust collects.
Now that the pain is outside of your body, it should not bother you so much. Enjoy!