Among the annoying things that can wreck a good night’s sleep, leg cramps top the list. If painful leg cramps are keeping you from falling asleep…waking you up…or even making you get out of bed, you need a solution. And you actually already have the remedy on hand—it’s in your sock drawer.

What causes the cramps: Sometimes called “charley horses,” these painful spasms seem to strike out of nowhere…are more likely to happen while you’re at rest or asleep…and tend to happen more frequently with age. Most leg cramps are harmless. They can be the result of overusing or straining leg muscles, particularly as age-related shrinking muscle puts extra strain on the muscle that’s left. They also can be caused by dehydration…not consuming enough potassium, calcium or magnesium…and oftentimes, the cause simply isn’t known.

Because leg cramps can sometimes signal a serious medical condition—such as diabetes, disorders of the nerves, liver or thyroid, narrowing of the arteries that deliver blood to your legs or spinal nerve compression—it’s wise to mention them to your doctor if you get them frequently.

But as long as you know that your leg cramps are the harmless kind, let’s get back to that sock drawer. Here’s what you do: Take out a pair of socks, and put them on your feet!

Are you surprised that something so simple could work?

Here’s why it works: Cold feet constrict blood vessels, which slows down blood circulation in your legs, including to the muscles in your legs. Keeping your feet warm in the evening, including during the two or three hours before you go to bed, restores better circulation to your feet and legs. So if you usually kick off your shoes and socks at the end of the day and pad around the house barefoot, don some cozy slippers instead! And wear socks to bed.

For extra-toasty toes: You also can tuck a hot water bottle under the covers at the foot of the bed. Or take a bath before bed—and spike the tub with Epsom salts to increase the muscle relaxing effects.