Can’t sleep? It may be something you didn’t eat. If you’re looking for foods to help you sleep, you’ve got to make sure you’re choosing the right ones.

The brain depends on a complex array of nutrients to ensure peaceful, uninterrupted slumber. So, the food you eat throughout the day – and the foods you eat right before you head to bed – can have a direct effect on how well you sleep. Choosing foods that provide sleep-inducing or sleep-enhancing nutrients can help you drift off to sleep more easily, wake up well-rested and feel more energized throughout the day.

Wondering where to start? We’ve got your guide to foods for good sleep. If you’re battling nighttime wakefulness, eat these foods 1 to 4 hours before bed to sleep more soundly.