Magnesium and Sleep
How Does It Work?
Magnesium has been found to reduce mental and physical stress by regulating the sympathetic and parasympathetic nervous systems. An imbalance of these systems can lead to irritability, lack of concentration, sleep disorders, or depression.
The mineral helps produce melatonin, an important hormone that assists in sleep regulation. Magnesium also connects to gamma-aminobutyric acid (GABA) receptors, the neurotransmitter responsible for relaxing nerve activity. This is the same neurotransmitter used by prescription sleeping drugs.
Additionally, research shows that magnesium alleviates anxiety and depression, making for a calm mental state upon bedtime. 
For general health, the National Institute of Health’s Office on Dietary Supplements puts the Recommended Daily Allowance (RDA) for magnesium at 310 mg per day. This is considered low by some natural health practitioners, including myself. I take at least 500 mg. Because of its relaxing effect, if you want to use magnesium as a sleep aid, it’s best to use it before bed.