The disruption to your sleep is one of the most frustrating aspects of chronic back pain. When you’re sleep-deprived, your pain feels worse — and when your pain is severe, it’s even harder to fall asleep. If you’re having trouble falling and staying asleep at night because of a bad back, try these five strategies for improving your sleep.

Assess Your Mattress

Sleep should bring relief, not make your pain worse. If your mattress causes pain in your pressure points, it’s not the right fit for your body and sleep style. It may be too firm, too soft, or simply old and due for replacement. In any case, it’s worth buying a mattress that’s comfortable for you. Mattresses aren’t cheap, but losing sleep costs you in the long run. There’s no perfect mattress for back pain sufferers, but you can find the right mattress for you by testing mattresses and looking for one that supports proper spinal alignment. When possible, choose mattresses that offer a trial period so you don’t get stuck with an uncomfortable mattress.

Change Your Sleep Position

According to the National Pain Report, the best sleeping position for back pain sufferers is lying on your pack with a pillow supporting your knees. If you have a herniated disk, you may find more relief from sleeping in the fetal position. Sleeping on your side is fine too — just put a pillow between your knees to align your hips and spine. Stomach sleeping, however, should be avoided, Popular Science advises. Sleeping on your stomach can aggravate back pain.

Find Safe Pain Relief

Many people control their pain with over-the-counter nonsteroidal anti-inflammatory drugs, but NSAIDs aren’t ideal for daily use. Overuse of NSAIDs can cause “stomach pain, ulcers, bleeding, or even kidney damage,” Harvard Health warns. For severe pain, opioids, muscle relaxants, and antidepressants are prescription options.

Several drug-free therapies can supplement or replace medication for back pain relief. Physical therapy is a great place to start. Physical therapy can help correct certain underlying causes of back pain and improve mobility in chronic pain sufferers. Some people with back pain also find success with CBD, or cannabidiol. CBD has anti-inflammatory properties that reduce pain, and unlike other cannabis products, CBD doesn’t affect your mental state. Still, it’s not right for everyone, so research and develop an understanding of how CBD works before trying it.

Shift Your Focus

With nothing else to occupy your mind as you lay in bed, your focus inevitably shifts to your back pain. However, fixating on pain only amplifies it and adds to your stress. Find healthy, calming ways to occupy your mind as you fall asleep so you’re not thinking about pain. Guided visualizations and mindful breathing are two techniques that experts swear by.

Stay Active

Exercising when you’re in pain isn’t easy, but if you have chronic back pain, you need to stay active. As Spine-Health explains, exercise strengthens your back muscles and alleviates stiffness so you experience less pain day-to-day. Working out also provides a short-term endorphin rush that reduces the severity of your pain and lifts your mood — an important benefit when you’re living with daily pain. Although exercise is important, certain exercises could worsen your back pain. You should always talk to your doctor or physical therapist before starting an exercise plan so you don’t risk further injury.

You deserve to sleep through the night without back pain waking you up. While chronic pain can make quality rest feel impossible, don’t underestimate the power you have. Use these tips to improve your sleep, and if you’re still suffering, talk to your doctor about the next steps.