I heard that one of the reasons a person gets cavities, it is most likely due to deficiency of silica in your diet, poor overall nutrition, and prolonged mistreatment of your teeth by eating enamel dissolving foods (like carbonated soda pop)
These are the two things I've researched online.
Method 1: Obtain more silica in your diet by consuming a particular species of Horsetail. The Latin name is Equisetumhyemale. It is an upright, non branching species of horsetail that kind of looks like skinny dark green bamboo. All aerial parts of the plant are edible. You do not want the species that has small branchings at each joint because that species is mildly toxic. You want to eat horsetail because has the most silica of any edible plant in the natural world.
Horsetail powder can be purchased at organic grocery stores (like Mothers) or online. Horsetail plants can be purchased at most plant nurseries. If you can't afford either, check to see if some of your neighbors or parks have horsetail plants growing in their front yards as they are a common decorative plant (but please, no stealing).
Method 2: Obtain more nutrition. Remember that indigenous tribes eating indigenous foods have had nearly always perfect teeth and almost supper human health by modern American standards, and that their health declined substantially when they start eating a more Western diet. (There are a lot of Native Americans alive today who have horrible teeth who had ancestors who had beautiful, cavity free teeth. The Native Americans who live on reservations who are sent food from the government that is based on the food pyramid tend to have all the same problems as the rest ofAmerica, such as obesity and terrible teeth)
What you need to do is avoid all processed foods, and instead eat nutrient dense foods such as chicken eggs, goose eggs, dandelions, wheat grass juice, and sprouts. Cordyceps and garlic are also good foods to add to your diet. Eggs should appear to have a dark orange yoke, not a yellow one (yellow yoked eggs are practically anemic. Yolk color has nothing to do with breed of chicken). Sometimes the best way to make sure you are getting the absolute best food is to grow it yourself (I had no idea carrots were naturally sweet until I started growing them in my backyard. I have eaten carrots at least once a week for every week of my life and eating a sweet carrot was a complete shock to me when I did so for the first time at the age of 21).
Good luck. Don't drink soda pop.