What magnesium actually does
Magnesium is a mineral your body uses in hundreds of processes — muscle and nerve function, blood-sugar control, blood pressure, and making the energy your cells run on. Many people don't get quite enough from food, and in a hot climate like Hua Hin's you lose minerals through heavy sweating, which is one reason night cramps and that 'wired but tired' feeling are common.
Because it's involved in the nervous system and muscle relaxation, it's earned a reputation as a calming, sleep-friendly mineral. That reputation runs a little ahead of the science — the studies are small and mixed — but it's inexpensive and safe enough that it's a reasonable thing to try.
The forms — this is the bit that matters
This is where most people waste money. 'Magnesium' on a label could be any of several compounds, and they behave very differently:
Magnesium glycinate (or bisglycinate) is well absorbed and gentle on the stomach — the usual pick for sleep and general use. Magnesium citrate is also well absorbed and mildly laxative, handy if you're also prone to constipation. Magnesium malate and threonate have their followers too. Magnesium oxide is the cheap one filling most supermarket bottles — poorly absorbed, so most of it passes straight through and its main effect is loosening the bowels.
For sleep or cramps, look for glycinate. For value, check the label for the actual form, not just the milligrams.
How people use it for sleep and cramps
For sleep, a common approach is a modest dose of magnesium glycinate in the evening, an hour or so before bed, as part of a wind-down routine — dimmer lights, less screen time, cooler room. Magnesium isn't a sedative; think of it as removing a small obstacle to sleep rather than knocking you out.
For night-time leg cramps, some people find magnesium helps and some don't — the evidence is genuinely split — but given how cheap and low-risk it is, it's a fair thing to try for a few weeks alongside staying well hydrated, which matters a lot in this heat.