If you think you might have a cavity, it's essential to see a dentist as soon as possible. Cavities are caused by tooth decay, which occurs when bacteria in the mouth produce acids that eat away at the tooth enamel. If left untreated, cavities can cause pain, infection, and tooth loss. While cavities can be treated with fillings, the best way to prevent them is to brush and floss regularly and avoid sugary foods and drinks. If you have a cavity, your dentist will remove the decay and give you a filling. In some cases, a root canal may be necessary. With proper care, cavities can be treated and prevented. So if you think you might have one, don't wait to see a dentist.