People take magnesium to prevent or treat magnesium deficiency. Magnesium deficiency is not uncommon in the US. It’s particularly common among African Americans and the elderly.Magnesium is also used as a laxative for constipation and for preparation of the bowel for surgical or diagnostic procedures. It is also used as an antacid for acid indigestion