You can't prevent genetic conditions like Celiac disease or enamel hypoplasia, but physical effects like acid erosion are under your control. To prevent acid from eating away at your enamel and thinning your teeth, try to reduce your consumption of soda, fruit juice, and other acidic foods and beverages with natural counterparts. If you eat or drink something acidic, remember to rinse your mouth out with water to rinse away the residue.
Health conditions that expose your teeth to stomach acid are grounds to see your medical doctor for more direct precautionary treatment. To protect your teeth in the meantime, rinse your mouth with water following an episode of vomiting or acid reflux. You should also wait 30 minutes after this acid exposure to brush your teeth—brushing too soon afterward could damage your enamel.