To prevent cavities, you need to remove harmful bacteria from your teeth. Brushing twice a day and flossing at least once a day is the best way to keep your teeth clean every day. Brushing and flossing also helps to stimulate your gums, keeping them healthy. That helps prevent gum disease.