1. Stay away from foods with a lot of sugar. Avoid eating foods with a lot of sugar; almost all toothaches happen almost instantly after eating these foods. Some of these foods include: hard candy, ice cream, candy bars, sugary cereals, and sugary liquid (like maple syrup).
2. Stay away from cold weather. Teeth should be kept as warm as possible. Cold weather will trigger a toothache if you've a cavity. Once chilled, it's almost always too late to get to some place warm. So it's better to just stay away from all cold as much as possible. If you must go where it's cold, stay out in the cold as much as possible. Being exposed to cold weather for a while will trigger a toothache.
3. Avoid any foods that are difficult to chew. Hard foods put pressure on your teeth when they are chewed. Avoid eating food that is hard to chew. When you put a lot of pressure on a tooth--with a cavity-- this will likely lead to a toothache.
Some of the typical foods to avoid that are hard to chew are: carrots, beef jerky, steak, and nuts, just to name a few. Obviously, you should avoid foods that are tough to chew.
You can avoid toothaches by following these guidelines, but you can't get rid of them entirely if you have a real cavity. You will always want to visit a dentist ASAP to properly fix it, like Pacific Dental & Fastbraces til you have the cavity repaired or removed, you'll always suffer from a toothache.