Depending on the state of your infection, your dentist may consider one or multiple of the following treatment options:
Draining the abscess. Your dentist might make a small incision to allow the abscess to drain out. Typically after this, that area is washed with saline.
Performing a root canal. After drilling down into your tooth and removing the diseased pulp, your dentist will drain the abscess and fill and seal your tooth's pulp chamber and root canals. Your tooth may then be capped with a crown or another restoration.
Prescribing antibiotics. If your infection is in the process of spreading to nearby areas in your mouth, your dentist may prescribe antibiotics to stop the infection.
It should be noted that if you've let your tooth infection go untreated and if you have a fever or swelling or have trouble breathing or swallowing, you should seek medical attention immediately. It's likely your infection has now spread to other parts of your body, like your jawbone and surrounding areas.