Keeping a glass of water on the bedside table is a simple but effective habit. Rehydrating immediately after a cramp — and before returning to sleep — helps restore the electrolyte environment that triggered the episode in the first place.
Magnesium before bed: a 3-ingredient approach to prevention
Prevention starts in the hours before sleep. Because magnesium plays a direct role in muscle relaxation — it is the mineral that signals a contracted muscle to release — ensuring adequate intake in the evening is one of the most practical steps available.

A simple, food-based approach involves a small pre-bed snack or drink built around magnesium-rich ingredients. The source points to a 3-ingredient magnesium-packed dessert as a nightly ritual to support muscle function. While the specific recipe is not detailed in full, the underlying principle is well-supported: foods such as dark chocolate, banana, and nuts or seeds deliver a meaningful dose of magnesium, potassium, and calcium in a single small serving.
For adults over 60, who are statistically more prone to both electrolyte depletion and disrupted sleep, this kind of dietary habit can complement — though never replace — medical advice. Anyone considering a magnesium supplement should first discuss dosage with a healthcare provider, as excess magnesium can interact with certain medications.
The immediate next step for anyone experiencing frequent nighttime leg cramps is a conversation with a general practitioner — particularly if the cramps are one-sided, accompanied by swelling or skin changes, or occur during activity rather than at rest. Blood tests can quickly identify electrolyte deficiencies or flag early signs of peripheral artery disease. For those already managing cardiovascular risk factors, the question of whether a magnesium supplement or dietary adjustment is appropriate is worth raising at the next scheduled appointment.

