The surest way to avoid getting or transmitting sexually transmitted infections (STIs) is to abstain from sex or to be in a long-term, mutually monogamous relationship with a partner who has been tested and isn’t infected. Condoms, when used consistently and correctly, can reduce your risk of getting chlamydia and gonorrhea.
In addition, you can protect yourself from PID by getting treated quickly if you do get an STI.
The most common preventable cause of PID is an untreated STI, mainly chlamydia or gonorrhea. CDC recommends yearly chlamydia testing of all sexually active women age 25 or younger and of older women with risk factors for chlamydia (those who have a new sex partner or many sex partners). If you have had chlamydia, you also should be re-tested several months after completing treatment so you can be re-treated, if necessary.