Ry Crist/CNET

If you have trouble sleeping at night, you may not need fancy sleeping tech, over-the-counter pills, warm milk or sheep to count. A cool house could be all you need to get the best sleep of your life.

For those of you that argue over how cool a room should be with your partner (guilty!), chilly is the right answer. According to the National Sleep Foundation, the best sleep happens in a room that's around 60 to 67 degrees F (15 to 19 degrees C) for adults and children, and between 65 and 70 degrees F (18 to 21 degrees C) for babies and toddlers.

That's not just a guess, though. Science backs it up.

Why does temperature matter?

As you go throughout your day, your body temperature goes up and down. When you get sleepy, your temperature starts to drop to get your body into sleep mode and to settle into REM sleep.

A warm room prevents your body from reaching its optimal sleep temperature, causing a restless night sleep and even insomnia. If you wake up sweaty, that's a sure sign that your room is too warm -- or you're using too many blankets.

Sleeping with the room too cold, though, isn't good for sleep either. Being too cold can make your muscles contract to stay warm, preventing you from relaxing and falling into a deep sleep.

Energy concerns

Worried about running up your electricity bill from keeping the A/C on all night? Run a fan instead, which can make a room feel 10 degrees cooler without using as much energy.

14 proven ways to get better sleep

Hopping into bed with sleep tech? Not so fast