Trouble sleeping? Lack of magnesium may be the cause. Magnesium regulates sleep and its deficiency can lead to insomnia and restless leg syndrome. It relaxes muscles, calms the nervous system, and promotes tranquility for a restful sleep. It also helps produce melatonin, the hormone that controls sleep-wake cycles. If you have sleep issues, check your magnesium intake. Leafy greens, nuts, seeds, and whole grains are good sources.