Milk of Magnesia, also known as magnesium hydroxide ... Magnesium hydroxide is sometimes used as an antacid along with other medications to treat heartburn, upset stomach, and indigestion. It works by ...