Magnesium oxide may be used for different reasons. Some people use it as an antacid to relieve heartburn, sour stomach, or acid indigestion. Magnesium oxide also may be used as a laxative for short-term, rapid emptying of the bowel (before surgery, for example). It should not be used repeatedly.