Treatment for a toothache depends on the cause. If a cavity is causing the toothache, your dentist will fill the cavity or possibly extract the tooth, if necessary. A root canal might be needed if the cause of the toothache is determined to be an infection of the tooth's nerve. Bacteria that have worked their way into the inner aspects of the tooth cause such an infection. An antibiotic may be prescribed if there is fever or swelling of the jaw.
Since most toothaches are the result of tooth decay, following good oral hygiene practices can prevent toothaches. Good oral hygiene practices consist of brushing regularly with fluoride-containing toothpaste, flossing once daily, rinsing once or twice a day with an antiseptic mouthwash, and seeing your dentist twice a year for professional cleaning. In addition to these practices, eat foods low in sugar and ask your dentist about sealants and fluoride applications.