If you’ve ever spent a night tossing and turning, you already know how you’ll feel the next day — tired, cranky, and out of sorts. But missing out on the recommended 7 to 9 hours of shut-eye nightly does more than make you feel groggy and grumpy.

The long-term effects of sleep deprivation are real.

It drains your mental abilities and puts your physical health at real risk. Science has linked poor slumber with a number of health problems, from weight gain to a weakened immune system.

Read on to learn the causes of sleep deprivation and exactly how it affects specific body functions and systems.

In a nutshell, sleep deprivation is caused by consistent lack of sleep or reduced quality of sleep. Getting less than 7 hours of sleep on a regular basis can eventually lead to health consequences that affect your entire body. This may also be caused by an underlying sleep disorder.

Your body needs sleep, just as it needs air and food to function at its best. During sleep, your body heals itself and restores its chemical balance. Your brain forges new thought connections and helps memory retention.

Without enough sleep, your brain and body systems won’t function normally. It can also dramatically lower your quality of life.

A review of studies in 2010 found that sleeping too little at night increases the risk of early death.

Noticeable signs of sleep deprivation include:

Stimulants, such as caffeine, aren’t enough to override your body’s profound need for sleep. In fact, these can make sleep deprivation worse by making it harder to fall asleep at night.

This, in turn, may lead to a cycle of nighttime insomnia followed by daytime caffeine consumption to combat the tiredness caused by the lost hours of shut-eye.

Behind the scenes, chronic sleep deprivation can interfere with your body’s internal systems and cause more than just the initial signs and symptoms listed above.

Your central nervous system is the main information highway of your body. Sleep is necessary to keep it functioning properly, but chronic insomnia can disrupt how your body usually sends and processes information.

During sleep, pathways form between nerve cells (neurons) in your brain that help you remember new information you’ve learned. Sleep deprivation leaves your brain exhausted, so it can’t perform its duties as well.

You may also find it more difficult to concentrate or learn new things. The signals your body sends may also be delayed, decreasing your coordination and increasing your risk for accidents.

Sleep deprivation also negatively affects your mental abilities and emotional state. You may feel more impatient or prone to mood swings. It can also compromise decision-making processes and creativity.

If sleep deprivation continues long enough, you could start having hallucinations — seeing or hearing things that aren’t really there. A lack of sleep can also trigger mania in people who have bipolar mood disorder. Other psychological risks include:

You may also end up experiencing microsleep during the day. During these episodes, you’ll fall asleep for a few to several seconds without realizing it.

Microsleep is out of your control and can be extremely dangerous if you’re driving. It can also make you more prone to injury if you operate heavy machinery at work and have a microsleep episode.

While you sleep, your immune system produces protective, infection-fighting substances like antibodies and cytokines. It uses these substances to combat foreign invaders such as bacteria and viruses.

Certain cytokines also help you to sleep, giving your immune system more efficiency to defend your body against illness.

Sleep deprivation prevents your immune system from building up its forces. If you don’t get enough sleep, your body may not be able to fend off invaders, and it may also take you longer to recover from illness.

Long-term sleep deprivation also increases your risk for chronic conditions, such as diabetes mellitus and heart disease.

The relationship between sleep and the respiratory system goes both ways. A nighttime breathing disorder called obstructive sleep apnea (OSA) can interrupt your sleep and lower sleep quality.

As you wake up throughout the night, this can cause sleep deprivation, which leaves you more vulnerable to respiratory infections like the common cold and flu. Sleep deprivation can also make existing respiratory diseases worse, such as chronic lung illness.

Along with eating too much and not exercising, sleep deprivation is another risk factor for becoming overweight and obese. Sleep affects the levels of two hormones, leptin and ghrelin, which control feelings of hunger and fullness.

Leptin tells your brain that you’ve had enough to eat. Without enough sleep, your brain reduces leptin and raises ghrelin, which is an appetite stimulant. The flux of these hormones could explain nighttime snacking or why someone may overeat later in the night.

A lack of sleep can also make you feel too tired to exercise. Over time, reduced physical activity can make you gain weight because you’re not burning enough calories and not building muscle mass.

Sleep deprivation also causes your body to release less insulin after you eat. Insulin helps to reduce your blood sugar (glucose) level.

Sleep deprivation also lowers the body’s tolerance for glucose and is associated with insulin resistance. These disruptions can lead to diabetes mellitus and obesity.

Sleep affects processes that keep your heart and blood vessels healthy, including those that affect your blood sugar, blood pressure, and inflammation levels. It also plays a vital role in your body’s ability to heal and repair the blood vessels and heart.

People who don’t sleep enough are more likely to get cardiovascular disease. One analysis linked insomnia to an increased risk of heart attack and stroke.

Hormone production is dependent on your sleep. For testosterone production, you need at least 3 hours of uninterrupted sleep, which is about the time of your first R.E.M. episode. Waking up throughout the night could affect hormone production.

This interruption can also affect growth hormone production, especially in children and adolescents. These hormones help the body build muscle mass and repair cells and tissues, in addition to other growth functions.

The pituitary gland releases growth hormone throughout each day, but adequate sleep and exercise also help the release of this hormone.

The most basic form of sleep deprivation treatment is getting an adequate amount of sleep, typically 7 to 9 hours each night.

This is often easier said than done, especially if you’ve been deprived of precious shut-eye for several weeks or longer. After this point, you may need help from your doctor or a sleep specialist who, if needed, can diagnose and treat a possible sleep disorder.

Sleep disorders may make it difficult to get quality sleep at night. They may also increase your risk for the above effects of sleep deprivation on the body.

The following are some of the most common types of sleep disorders:

To diagnose these conditions, your doctor may order a sleep study. This is traditionally conducted at a formal sleep center, but now there are options to measure your sleep quality at home, too.

If you’re diagnosed with a sleep disorder, you may be given medication or a device to keep your airway open at night (in the case of obstructive sleep apnea) to help combat the disorder so you can get a better night’s sleep on a regular basis.

The best way to prevent sleep deprivation is to make sure you get adequate sleep. Follow the recommended guidelines for your age group, which is 7 to 9 hours for most adults ages 18 to 64.

Other ways you can get back on track with a healthy sleep schedule include:

  • limiting daytime naps (or avoiding them altogether)
  • refraining from caffeine past noon or at least a few hours prior to bedtime
  • going to bed at the same time each night
  • waking up at the same time every morning
  • sticking to your bedtime schedule during weekends and holidays
  • spending an hour before bed doing relaxing activities, such as reading, meditating, or taking a bath
  • avoiding heavy meals within a few hours before bedtime
  • refraining from using electronic devices right before bed
  • exercising regularly, but not in the evening hours close to bedtime
  • reducing alcohol intake

If you continue to have problems sleeping at night and are fighting daytime fatigue, talk to your doctor. They can test for underlying health conditions that might be getting in the way of your sleep schedule.

Keep reading: Tips on improving your sleep.