Preventing or treating magnesium deficiency, which is common. Magnesium is used as a laxative for constipation, and in cases of bowel preparation for surgical or diagnostic procedures. It is used as an antacid to treat acid indigestion. Magnesium is used for diseases of the heart and blood vessels, including chest pain. Arrhythmia. Hypertension. High cholesterol levels. Heart valve diseases, including mitral valve prolapse, and heart attacks. Magnesium is also used to treat attention deficit hyperactivity disorder. In cases of anxiety, depression and chronic fatigue syndrome. Lyme disease. Leg cramps during pregnancy and diabetes. kidney stones. Migraines. Weak bones (osteoporosis). Premenstrual syndrome. incontinence. Asthma and hay fever. Multiple Sclerosis