Milk of magnesia is used to treat heartburn and constipation ... For children under 12 years old, talk to a healthcare professional before using. When magnesium hydroxide is used as an antacid ...