If you’ve been trying to lose weight, you’ve probably already done the hard work of re-evaluating your food choices, and you’ve likely amped up your activity levels too. But there’s one crucial component to weight loss you may not have considered—and that’s sufficient sleep.

As it turns out, there’s a demonstrated connection between getting enough sleep and successfully losing weight. The National Sleep Foundation recommends that adults get seven to nine hours of sleep per night, but 2016 data from the CDC indicates that more than one-third of adults aren’t getting anything close to that. As it turns out, chronic sleep deprivation is pretty common, and it could be sabotaging your weight-loss journey. Here’s what you should know:

1. Sleep-deprived people are more likely to overeat.

“Sleep deprivation affects hormones that regulate appetite and satiety, which leads to overeating and poorer food choices,” says Janet Kennedy, Ph.D., a clinical psychologist and founder of NYC Sleep Doctor.

A study from 2004 found that sleep deprivation affects the hormones ghrelin and leptin—ghrelin stimulates your appetite, and leptin helps tell you when you’re full. The researchers asked 1,024 people to keep a sleep diary, participate in an overnight sleep study in a lab, and have their hormone levels checked. They concluded that the participants had reduced leptin and elevated ghrelin, meaning they were more likely to have increased appetite.

2. Lack of sleep can make you crave unhealthy foods.

A big part of successful weight loss is making healthy food choices, and it turns out that your sleep habits can affect that process too. One study asked a group of sleep-deprived people and another group of well-rested people to rate more than 80 foods, from potato chips to strawberries, based on how badly they wanted to eat that food at the time. They found that sleep-deprived people craved high-calorie, junky foods like potato chips more than the well-rested people—regardless of how hungry they actually were.

The researchers determined that sleep helps regulate a part of your brain involved in governing your food choices, and sleep deprivation affects your frontal lobe and alters your brain state, making high-calorie junk foods more appealing.

“When that hormone cycle is disrupted, we may find ourselves reaching for less healthy options including those high-sugar, high-fat foods,” says Kristi L. King, R.D., C.N.S.C., a senior pediatric dietitian at Texas Children’s Hospital. “Best advice—plan ahead. If you know you’re going to have a busy week, plan your meals and snacks, and package healthy snacks in advance, so all you have to do is grab and go.” For instance, you can put together healthy snack bags to grab as you head out the door.

If you’re super tired and just don’t feel up to meal prepping, do what you can. “Count on convenience foods and use the label to make wise choices,” says Caroline West Passerrello, MS, RD, a spokesperson for the Academy of Nutrition and Dietetics. “Include foods with fiber and nutrients while limiting those with added sugars or high sodium levels.”

3. Sleep can change your appetite levels through insulin regulation.

“Sleep affects the way the body responds to insulin,” says Nate Watson, M.D., former president of the American Academy of Sleep Medicine. “Sleep deprivation promotes insulin resistance, so the body becomes less sensitive to insulin, making it less efficient in moving glucose from blood into the cells of the body.”

Essentially, sleep deprivation alters the way your body metabolizes glucose, a kind of sugar your body breaks down from foods and uses as fuel, which can increase your insulin levels and mess with your appetite and hunger.

“All the extra glucose in the bloodstream is converted into fatty acids and stored in the fat tissues of your body, contributing to obesity,” Watson explains.

4. Sleep-deprived people can struggle with self-control.

For most people, routine and commitment are an important part of weight loss. Sticking to your meal plan and staying active can lead to the results you want, but the best of intentions don’t matter if you can’t follow through with your plans.

According to research out of Clemson University, sleep deprivation is linked to poor self-control and impulsive decision-making. That means that when you’re not rested enough, you might be more likely to ditch your workout buddy, impulsively eat junk food, or generally make decisions that aren’t in your best weight-loss interests.

5. Sleep is important for working out.

If exercise is part of your weight-loss plan, take note: Studies show that sleep deprivation can affect your athletic performance by tanking your endurance. Sleep likely plays a big role in post-exercise recovery too. So for optimal performance in the gym, make sure you’re getting your zzzs.

So what should you do about it?

According to Kennedy, it’s hard to definitively tell whether sleep deprivation is affecting your weight loss—or by how much. But evaluating your sleep habits can still lead to good outcomes:

“Sleep, diet, and activity are all connected,” Kennedy says. So if you think you might be sleep-deprived, following basic sleep hygiene can make a huge difference. Here are a few of Kennedy’s best tips for better sleep (and healthy weight loss):

  • Get up at the same time each day so your body can get into a rhythm.
  • Don’t use your bed as a hangout spot—try to avoid getting into bed until you’re ready to wind down.
  • Unplug from phones, tablets, and computers at least an hour before bed.
  • Create a simple bedtime routine to signal to your body that it’s time to sleep.
  • Keep phones and any other “connected” devices out of the bedroom (or at least across the room).
  • Avoid heavy meals close to bedtime.
  • Exercise (but not right before bed).
  • If you have racing thoughts, don’t just hang out with them—get up and write them down, then do something relaxing to distract your mind while your body’s fatigue takes over.
Nina Bahadur is a freelance writer, editor, and consultant based in NYC.