When your head hits the pillow, you'd like to fall asleep and stay asleep. There are certain foods that just won't allow Besides making you cranky in the morning, poor sleep is linked to obesity and stress.

If you want to improve the quality of your sleep, there's more to do than simply turning off the lights and unplugging: what you nibble on before bed can effect how well you hit the sack. Look no further than these five foods that can ruin a good night's sleep.

Caffeine

Calling Captain Obvious: You should avoid caffeine at bed time. No surprise, but caffeine isn't just in coffee and energy drinks. It's also found in chocolate and black tea, which means you may be taking it in without even realizing it. Eating or drinking caffeine even late in the afternoon affects how you sleep. "If you have caffeine later in the day, it can actually predispose you to develop insomnia or make it worse if you already have it," Dr. Rachel Salas, an associate professor of neurology at Johns Hopkins Medicine who specializes in sleep medicine, tells SELF. A great alternative to try is Valerian root tea with honey.

RELATED: Slim fast? The truth about juice fasting

Pizza

You had it for dinner and you'll probably have it for breakfast; however, you definitely shouldn't have it as a late-night snack. Pizza contains an absurd amount of calories, saturated fat and carbohydrates that will just sit in your stomach as you lie awake in bed (a recipe for fat gain). Put down that refrigerated slice and opt to microwave popcorn instead. At only 30 calories a cup, what's not to love?

Sugary cereals

As yummy as it sounds, pouring yourself a big bowl of Reese's Puffs or other sugary cereals late at night will cause a spike in blood sugar, throwing off some of your sleep hormones. The next thing you know, you're waking up starving just a few hours later due to the overproduction of insulin. Not all cereal is a bad late night snack, though; try the whole-grain, complex carb kind that's easier to digest.

Spicy foods

We hear all the time that spicy foods are good for us, but that's not the case late at night, when these foods can actually keep you from going to sleep - especially if you're prone to heartburn. The spices can irritate your stomach and the chemicals in spicy food can stimulate your senses, making a good night's sleep more difficult. Instead, try snacking on fat-free yogurt.

Alcohol

A night of alcohol consumption can lead to lots of things, but a good night's sleep is not one of them. At first, the alcohol acts as a stimulant, flooding the brain with feel-good endorphins. Then, the booze wears off, leaving the user drowsy (which is why many people think alcohol is a good night-cap). But while you may fall asleep faster, there's a good chance you'll be restless and find yourself awake in the wee hours of the morning.