Magnesium is a mineral electrolyte that helps nerve and muscle function, blood sugar regulation, and heart rhythm among other important bodily functions. Most adults get enough magnesium through the foods they eat, though supplements may help those with deficiencies. Low magnesium levels have been linked to fatigue, muscle spasms, depression, and nausea.