Magnesium deficiency is often a precursor to sleep disorders, such as anxiety, hyperactivity and restlessness. It’s been suggested that this is because magnesium is vital for GABA function, an inhibitory neurotransmitter known to “calm” the brain and promote relaxation.