The treatment of these infections depends on several factors:
the size of the infection;
the course of the infection (whether it is acute or chronic)
the age of the patient and the possible presence of general diseases.
The first step is usually conservative treatment of the infection (without surgery), especially in the case of chronic infections. This involves "nerve treatment", i.e. endodontic therapy, which is successful and sufficient in most situations.
When endodontic treatment is not possible or is not successful (and sometimes there are objective reasons why it is not successful), surgical intervention is required - apicoectomy or root-end resection.
Fortunately, it is very rare for an infection at the root tip to end in tooth extraction.