Do you ever find yourself staring at the ceiling, wondering if you’ll ever fall asleep? Or maybe you wake up thinking it’s time to get up, but it’s actually 2 a.m.

If you’re in need of better sleep, it may be time to consider your sleep hygiene — and how your habits may be preventing you from getting the quality sleep you need.

Let’s get into what sleep hygiene is and the changes you can make to your daytime and bedtime habits to improve your sleep.

Sleep hygiene refers to healthy sleep habits. Good sleep hygiene is important because of how crucial getting good sleep is for your mental and physical health, as well as your overall quality of life.

Your behaviors during the day — not just before you go to bed — can affect how well you sleep. Your food and drink choices, schedule, evening routine, and many other activities all play a part in your ability to sleep.

If you don’t sleep well, you can take several steps, both during the day and before you go to bed, to improve your sleep.

That’s what sleep hygiene is all about: building various healthy habits to help you get a good night’s sleep.

Let’s take a closer look at 10 ways to improve your sleep hygiene for better sleep.

Try to go to sleep and wake up at about the same times every day — even on weekends. This reinforces your body’s sleep cycle (your internal clock), which can make it easier for you to fall asleep and wake up every day.

Sticking to a consistent schedule may also help reduce daytime sleepiness.

Make sure that the bedtime you pick allows you to get 7 to 8 hours of sleep each night.

A relaxing bedtime routine helps you unwind so you’re ready to sleep. And keeping a consistent routine helps your body recognize that it’s bedtime when you start the routine. This may help you fall asleep more quickly.

The best time to start your routine is about 30 to 60 minutes before you go to bed.

Your routine can include whatever makes you feel most relaxed, unless it involves a device that emits blue light. Here are some ideas:

  • Take a warm bath or shower. Not only is the water relaxing in the moment, but the drop in your body temperature as you cool down afterward may make you feel sleepy.
  • Try some gentle stretches to help your muscles relax and release tension.
  • Spend a few minutes meditating to help calm your body and mind.
  • Try listening to some soothing music while you focus on your breathing.
  • Spend time reading a book, but try to stay away from electronic reading devices.

Avoid anything stressful or overly stimulating, like emotional conversations or working.

Electronic devices like your phone emit blue light, which can reduce the melatonin levels in your body.

Melatonin is a chemical that controls your sleep/wake cycle. When your melatonin levels dip, it can be more difficult to fall asleep.

Devices that emit blue light can also distract you, keeping your brain alert. This may also make it harder to fall asleep.

You might think that not looking at your phone close to bedtime is enough, but keeping your phone near your bed can disrupt your sleep, even if you’re not aware of it.

The message notifications, buzzing, and light that can suddenly pop on in the middle of the night can wake you up momentarily, leading to an interrupted sleep.

As little as 30 minutes of aerobic exercise a day can improve your sleep quality, as well as your overall health. And if you can exercise outside, that might increase the benefits even more, since exposure to natural light helps regulate your sleep cycle.

But if you can’t get outside, don’t worry. Even regular indoor exercise may help you sleep better.

Just avoid exercising within an hour or two of your bedtime. This can increase your energy levels and body temperature, which may make it harder to fall asleep.

If you want to do some type of activity later in the day, try doing stretches or yoga.

The effects of caffeine can last 3 to 7 hours after you consume it. This means that your afternoon cup of coffee may keep you awake and alert a lot longer than you’d like.

Although it’s usually best to limit your caffeine intake to the morning hours, keep in mind that everyone has a different tolerance to caffeine.

Some people may be able to stretch their consumption to midafternoon, while others might need to cut themselves off much earlier in order to fall asleep easily.

The less caffeine you consume, the more sensitive you may be to its effects.

A cool, dark, quiet room may help you fall asleep and stay asleep more easily.

For most people, a bedroom temperature between 60°F and 67°F (15.6°C and 19.4°C) is the optimal temperature for sleeping.

It’s also important to make sure you have a comfortable mattress, pillows, and bed linens. The more comfortable you are, the easier it may be to fall asleep and stay asleep.

If you’re a light sleeper or have noisy neighbors, a good pair of earplugs may help you sleep without being disrupted.

Also, if your bedroom gets flooded with too much light, you may want to consider using blackout curtains or an eye mask to keep your sleep environment as dark as possible.

When you have a comfortable bed, it might be tempting to use it for reading, working, talking on the phone, watching TV, or other activities.

But it’s important to use your bed for sleep and sex only. This helps strengthen your brain’s association between your bed and sleep, making it easier to fall asleep.

Reading may be one way you relax before going to sleep, but even books can be disruptive to your sleep if they keep your brain alert. Try reading on the couch before moving to your bed instead.

If you’re not tired, avoid lying in bed while you toss and turn. Instead, try doing a relaxing activity until you start to feel tired, then head to bed.

If you don’t fall asleep within 20 minutes of going to bed, get up. Not being able to fall asleep may cause you to become frustrated, which can keep you awake even longer.

Once you get out of bed, do something to help you unwind, like reading on the couch, until you’re tired enough to go back to bed.

Napping during the day can make it harder to fall asleep later and may make you more prone to waking up during the night.

If you do need to nap:

  • Keep it to 30 minutes or less.
  • Avoiding napping later in the afternoon.

Napping may affect the sleep pattern of older adults more than younger people, but the extent of this is still unclear.

Thinking about things you’re worried about can keep you awake at night. To help keep your worries from keeping you awake:

  • Write down your worries before going to bed, to help get them out of your head.
  • If your to-do list stresses you out, write that down as well. Prioritize what you need to do tomorrow and the rest of the week, then try to relax.
  • Research suggests that a weighted blanket may help with anxiety and insomnia, and may provide benefits similar to deep pressure therapy.
  • Try meditation before bed to help calm your mind.

Sleep hygiene is about having healthy sleep habits. Your behaviors, both during the day and around bedtime, can affect the quality of your sleep.

If you have a hard time falling asleep or staying asleep, you can try several strategies to fall asleep faster — and stay sleeping for hours at a time. Most of these involve improving your sleep hygiene.

Sticking to a schedule, having a relaxing bedtime routine, exercising regularly, keeping your bedroom dark and at a comfortable temperature, and watching what you eat and drink can all impact the quality of your sleep.

If you continue to have issues with your sleep patterns or insomnia, be sure to follow up with your doctor. They can determine whether an underlying condition is causing your sleep problems and can provide the treatment you may need.