We have all been there: the sleepless nights of tossing and turning, throwing off the covers, and plugging in all the fans you own. But no matter what you try, you are still left sweaty, sticky, and miserable. Summer is officially here, and yes, that means heatwaves

Being hot during the daytime is uncomfortable in itself, but adding sweltering heat to bedtime becomes a whole other ballgame. Lack of sleep can greatly affect our mood the following day, but coupling that with excessive heat can also lead to health issues such as dehydration and headaches.

Luckily, there is a way to help you cool down before bed – but it completely contradicts what you might think. Shockingly, the best way to stay cool at night is to drink a hot beverage before you go to sleep.

University of Ottawa researcher, Ollie Jay, shared in a piece for Stylist that a warm drink can actually lower the heat stored inside your body. Here’s the science behind it: as soon as the beverage hits your temperature receptors, you produce more sweat. Thus, the profuse amount of sweat will cool on your skin, making you feel colder.

The same rule applies for the daytime, as well. It has been proven that a hot drink (such as coffee or tea) on a sweltering day will actually make you feel cooler than an iced one. However, most people can’t drink caffeinated drinks directly before bedtime, so what warm beverage is recommended at bedtime? The answer: warm milk.

Warm milk has sleep benefits besides just being hot. It also contains tryptophan, an amino acid that produces all those wonderful hormones (such as melatonin and serotonin) to help you sleep like a baby. If you can’t drink cow’s milk, no worries — my fellow lactose intolerant or vegan friends can substitute real milk for almond milk, which also has vitamins and nutrients to help calm the brain.

Besides the hot drink trick, there are many other ways that can help you get a good night’s sleep. Sleeping separately, using cotton sheets, and avoiding exercise in the evening can also aid in preventing a sweaty, sleepless night.