There are two types of muscle fibers that stabilize and move the hips and lower extremities. The first kind are called Tonic muscle fibers and they are always working to keep us stable when we're not lying down. They tend to be tight and short. During rest, they can get tight and need to be stretched when we are active again.
Important Tonic muscles in the hip area are the Iliopsoas (or hip flexor) and hamstring muscles. Below I will describe two stretches for them:
For the Iliopsoas, stand and take a step forward with one foot. Make sure your hips are facing forward and you're not twisting to one side. Tuck your butt so that your lower back curve flattens out a bit. This should create a stretch in the groin on the leg that is behind you. Hold for 30 seconds and take a few deep breaths. Do this multiple times per day - and the longer you sit, the more you should do it.
The hamstring stretch you're going to do lying down on your back. Scoot close to a doorway where you can put one foot up against the front of the door jam with the other leg extending through the doorway opening. (If you're really inflexible, you may only be able to put your foot up on the door jam a couple feet. The more flexible you are, the further up the door jam you can put your foot and the more straight up and down your leg will be.) Then do the following:
The other type of muscle fibers are called "phasic". They only work when needed and tend to be weak and thus require strengthening instead of stretching. Important phasic muscles of the hip area are the abdominal and buttock. Below are two strengthening exercises for them:
For the abs, a basic "crunch" will do. Lie on your back, clasp your hands behind your head and lift your head and shoulders off of the floor a couple inches and hold it for as long as you can while taking a few deep breaths. Repeat 3 times.
For your Gluteal muscles or your Butt, stand and bring one leg slightly behind you so that the toes of that foot are pointed touching the floor. Shift your weight to the leg in front so that the foot in back is just for balance and lift the rear leg up being careful to feel your butt contracting and doing the work. Squeeze it as tightly as you can as you lift your back leg while standing strong on your forward leg. Repeat 10x. Do the same thing on the other side.
Depending on what kind of hip pain you have, I may recommend further exercises that you can perform at home as part of your treatment plan.