The cycle of anxiety and pain can be frustrating. As you become more anxious, you may tense up, feel more aware and hyper alert, and then feel more pain. Then, as the pain gets worse, the cycle continues.
The best thing to keep pain from getting worse may sound too simplistic, but it's to stop the pain before it gets bad. If you have a prescription for pain relievers, don't wait until the pain is really bad before you take them. Pain relievers work best before your pain hits its peak. Take your medication as prescribed too; this will help control your pain.
If your pain is not being controlled with pain relievers, there are other options you can explore. Some people learn to use imagery or biofeedback to relieve their anxiety and thus relieve their pain. There are many techniques are available, and you may need to try more than one before finding the one that helps you. Also, many of the techniques take practice, so it's important to be consistent with using them.