Have you been given stretches to do, and if so, do you do them? Its amazing how much they can help.
When you sit, do you sit straight, or maybe with your feet under you to one side (if that makes sense), or with your shoulders forward and your lumbar spine pushed back (slouching)?
If its recurring, it may be that its something like how you sit or how you walk that is causing things to go out - do you have a heavy bag on one shoulder? Again, that pushes the spine out of alignment.
Something like Alexander technique can help, but there are simple stretches that can too.
Stan up straight with your hands by your sides, palms open flat against your body. Keeping the hands on your body, but sliding down with the movement, bend sideways from the waist, slowly till you feel like you are as far as you can comfortably go while feeling a stretch - its not a big movement. Hold for two or three seconds. Move slowly though, as part of the benefit is in the movement as well as in the stretch. Move back, slowly, and do the same the other side. Does one side feel tighter or a bit more painful than the other? If you feel one side more, its definitely a good stretch to do, although can still be beneficial if you feel tension equally on both sides.
One other simple stretch is to put your fists in the small of your back and then push your pelvis forward, stretching out your lumbar spine.
Do these two or three times, two or three times a day, and they can help mobilise the joints of the lower back and reduce pain, in back, hip and shoulder.
I hope this is of help to you, but do the stretches slowly and don't force them, as the tightness eases you will find them easier (if they address your specific problem). If they help and there is a root cause that isn't addressed then you will have to keep stretching etc, as the problem will recur.
Best wishes
Smoorikins