Even if you know the importance of getting enough sleep each night, what happens when your desire to fall asleep isn’t enough?

For the 30 million Americans living with type 2 diabetes, falling and staying asleep may be a challenge. Sleep difficulties and diabetes have long been linked, and the issue often worsens as people age.

The National Institute on Aging notes that older adults need about the same amount of sleep as all adults. In general, this target number is seven to nine hours each night.

While this amount of sleep is ideal, many older adults experience interruptions in sleep due to illnesses, medications, pain, and certain health conditions — including type 2 diabetes. Older adults may also face insomnia, which tends to increase as you age.

Lifestyle practices that promote good sleep are known as “sleep hygiene.” Many of the most effective sleep hygiene techniques are things that you can do on your own at home. For people with type 2 diabetes, managing the condition closely may also help.

Here are 10 tips you can try to help improve the quality and quantity of your sleep.

1. Focus on controlling your blood sugar

Managing your blood sugar effectively may help improve your nightly rest. Williams recommends focusing on lower glycemic foods to avoid the fluctuations of high and low blood sugars that can contribute to poor sleep.

For example, you might choose a high-protein snack like nuts over a sugary cookie. Avoid nighttime low blood sugar. A continuous glucose monitor might help you detect any episodes of nighttime lows.

2. Avoid caffeinated beverages at night

Black tea, coffee, caffeinated sodas, and even chocolate can interfere with your ability to fall asleep. For a better night’s sleep, limit the amount of caffeine you consume throughout the day with a goal of eliminating it several hours before bed.

3. Participate in regular physical activity

Exercising most days of the week can help improve the quality of your sleep. Williams says that physical activity contributes to improved blood sugar management.

Plus, regular exercise can improve mood, which helps to lower stress and leads to better sleep. Aim to get at least 30 minutes of exercise five days per week.

4. Aim for a healthy weight

If you’re overweight, work with your doctor to set goals for weight loss and management. Williams says that losing 10 percent of your body weight can lead to better blood sugar control, and decrease the risk of depression and sleep apnea.

5. Power up your protein

Hegazi recommends focusing on high-quality sources of protein like chicken, eggs, and seafood. Eating protein throughout the day can help you manage your blood sugar levels more effectively.

6. Ditch the distractions

The bedroom should be for sleeping only. Television, smartphones, tablets, and even clock radios that are too bright can interfere with your ability to fall and stay asleep. If you need to have your cell phone by your bed, change the settings to only receive messages that are an emergency.

7. Stick to consistent sleep times

Going to bed and waking up at the same time each night helps regulate your body’s own internal clock. Even on the weekends, aim to be consistent.

8. Create a bedtime ritual that includes relaxing activities

Winding down and relaxing one to two hours before bed can help your body get ready for sleep. Consider a gentle yoga routine, breathing exercises, reading, or a warm bath.

9. Limit or avoid daytime napping

Naps can do wonders to help you get through the day. But if that 20-minute catnap is interfering with nighttime sleep, you might want to give it up for a while.

10. Create a sleep environment

The environment in your bedroom makes a significant difference when it comes to quality sleep. Make sure you have a supportive pillow and mattress. Avoid extreme temperatures of too hot or too cold. And limit the amount of light, both artificial and natural.

If adopting these lifestyle changes doesn’t improve your sleep, it’s important to talk to your doctor. Conditions that affect sleep can be serious and may lead to long-term health issues over time. Your doctor can assess whether you may have a more significant sleep issue, such as diabetic neuropathy or sleep apnea, and recommend further tests or treatment.

There are a variety of reasons that people with type 2 diabetes, and especially older adults, may have trouble sleeping. Here are some of the more commonly known reasons:

Blood sugar issues

Blood sugar levels that are too high or too low can cause symptoms that make it difficult to fall and stay asleep. “If your blood sugar is too high, it can cause frequent urination and a need to constantly get out of bed,” explains Refaat Hegazi, MD, PhD, a board-certified physician nutrition specialist.

On the other hand, Hegazi notes that low blood sugar can cause symptoms like dizziness and sweating, which can prevent you from sleeping well. If you’re having difficulty managing your blood sugar levels, “nocturnal hypoglycemia” may be an undetected symptom, he adds.

Sleep apnea

People living with type 2 diabetes are also at risk of developing sleep apnea — a potentially serious condition that occurs when your breathing repeatedly stops and starts throughout the night. This can dramatically impact the quality of your sleep.

Peripheral neuropathy

Peripheral neuropathy is a complication of type 2 diabetes that can occur when high blood sugar levels lead to nerve damage. A frequent symptom of diabetic neuropathy is the feeling of nocturnal feet burning and pain sensation.

Nerve damage can also contribute to restless legs syndrome (RLS), which causes uncomfortable sensations in the legs and an uncontrollable urge to move them. This can cause people with type 2 diabetes to experience poor sleep, notes Megan Williams, MD, a board-certified family physician who also specializes in obesity.

There’s a known link between type 2 diabetes and sleep difficulties. If you’re having trouble sleeping, adding some basic sleep hygiene practices into your nightly routine may help. It’s also important to properly manage your blood sugar levels. If you continue to have difficulty, contact your doctor to create a more comprehensive plan.