By eating more of the "best" foods, and fewer "not-so-good" foods, you can maintain optimal levels of healthy bacteria and excellent teeth strength, which will help prevent cavities and other diseases.
Foods rich in calcium and phosphorous help to mineralized teeth, so be sure your diet includes plenty of cheese, yogurt, chicken and meat. Xylitol, a sugar-like substance that comes from birch trees, is also useful for oral health; use it in place of sugar in your coffee or baking. Most fruits and veggies are great due to the high water content, which offsets the small amount of sugar they contain.
Foods that are acidic, like citrus fruits (lemons and limes, especially) and tomatoes should be eaten with other foods, and followed by a glass of water to rinse away the enamel-destroying acids.
Milk, water and unsweetened tea can be consumed as you wish, but acidic drinks high in sugar like soda, lemonade, sweetened tea and coffee drinks and juices.