Woke up with hip pain

Carey
My hips are killing me... If I lay on either side after a while I'm so sore. My hips and lower back and kept my up all night. I tried a pillow between my legs but it didn't help. What can I do to prevent this? Or do I just have to deal with it?? Any suggestions would be great!!