It is not always necessary.
Antibiotics are used only in the following situations:
Widespread infection
Facial swelling
Systemic symptoms (fever, etc.)
Patients with weakened immune systems
Special clinical situations deemed appropriate by the physician
The main treatment is root canal disinfection and filling; antibiotics are only supportive.