Not having sex and avoiding sexual activity is the surest way to prevent gonorrhea. But if you choose to have sex, use a condom during any type of sexual contact, including anal sex, oral sex or vaginal sex.