To treat PID, you will take antibiotics. Take them as directed. If you don't take all of the medicine, the infection may come back.
If your infection was caused by a sexually transmitted infection, your sex partner(s) will also need to be treated so you don't get infected again. Do not have sex until both of you have finished your medicine. And be sure to follow up with your doctor to make sure that the treatment is working.
If you have a very bad case of PID or are also pregnant, you may need to stay in the hospital and get antibiotics through a vein (intravenous). Sometimes surgery is needed to drain a pocket of infection, called an abscess.
Your risk of infertility increases each time you have PID, so it is very important to prevent future infections. Using a condom each time you have sex can reduce your chance of getting a sexually transmitted infection that could lead to PID.