We all have those days where we just spend the entire daydreaming about your bed. Bedtime can’t come sooner, and when the time finally comes, you feel like you’re going to fall asleep the minute your head touches your pillow. But as soon as you go to close your eyes, you can’t fall asleep.

Insomnia happens to all of us, even on those days when all we want to do is go to sleep. There are tons of ways to treat insomnia, from melatonin pills to bedtime music. But you also can treat insomnia with food, so be sure to eat these foods the next time you want to guarantee you get a good night’s sleep:

Dark Chocolate

A late-night snack that will satisfy your sweet tooth and help you fall asleep? Say no more. Dark chocolate is full of magnesium, which is excellent for helping you catch those z’s.

Brown Rice

Swap out your pasta for brown rice on those days you have a late dinner and still want to get to bed early. Brown rice shares similar properties to melatonin, rich in tryptophan, which is an amino acid that can help you get sleepy.

Almonds

Almonds are surprisingly full of melatonin and a great source of magnesium. Magnesium can help fight inflammation and reduce stress levels of cortisol, which can lead to restless nights.

Chamomile Tea

In addition to being anti-inflammatory, drinking a cup of warm chamomile tea is a great way to ensure you’ll get a good night’s rest. Chamomile has also been found to reduce anxiety and depression and improve your skin overall.

Spinach

Spinach can be enjoyed in a myriad of ways, from blended into a green smoothie to wilted in a pasta. Regardless of the way you choose to enjoy spinach, it’s a great food source to help you fall asleep. Spinach is high in magnesium and tryptophan, both of which can help you get to sleep no problem.