When tooth decay and bacteria are found, it is often the result of sugar. This is one of the worst food items for your teeth, especially if you eat it frequently. If you are sipping on coke all day long or enjoying sugary snacks off and on all day long, you are doing the worst damage possible to your teeth. You are providing a constant supply of sugar which is used for the growth of bacteria which in turn leads to tooth decay.
It is best to stay away from sugar completely, but if you need it, try to limit it to one sitting rather than spreading it out during the day. If you can enjoy it only as dessert when you have eaten other foods, that is even better. You can also make a point not to let the sugar sit on your teeth. You can brush your teeth or rinse with a Flouride based mouthwash right after eating the sugar.
If you chew gum, go with the sugarless varieties!
Remember, sugar is not just contained in pie and other sweet treats. Carbohydrates like pasta and bread break down into sugar and fruit is loaded with natural sugar. These things need to be watched just as much as the little white grains of sugar.
It was once believed that eating hard foods like apples and carrots could fight decay since they remove plague, but it is not entirely clear whether that is true or not. These foods still have some sugar in them. There really are no foods that can help you prevent tooth decay.
You also need to watch the acidic foods that you consume over the course of the day. Constant exposure to acids in grapefruit, limes and other foods can erode the teeth. This damage can be irreversible.