The primary treatment for appendicitis is surgical removal of the appendix, known as an appendectomy. This can be done through open surgery or laparoscopically. Antibiotics are also administered to treat or prevent infection. Prompt treatment is essential to avoid complications like a ruptured appendix.