Milk of magnesia is used to treat heartburn and constipation. The active ingredient, magnesium hydroxide, works by drawing water into the intestines. For adults and children aged 12 and older, the ...