How to Prevent STIs & HIV

Anyone who is sexually active at any age can get HIV or a sexually transmitted infection (STI), also known as a sexually transmitted disease (STD). The only way to completely prevent getting an STI or HIV is to not be sexually active. Fortunately, there are simple steps you can take to reduce your chances of getting an STI or HIV and support your sexual health.

A grid of colorful, assorted condoms in various wrappers on a pink background. Each package is vibrant, creating a playful and eye-catching design.

Before sex, take some time to discuss:

  • Boundaries
  • Whether either of you have other partners
  • STI testing history
  • HIV status. If your sex partners are HIV-positive, talk with them about their current HIV treatments. HIV is not transmitted through sex when they have an undetectable viral load, which is when a viral load is so low that it cannot be detected by tests.

Clear communication helps ensure informed consent, builds trust, and reduces the risk of disease spread. Make sure to talk about your sexual history and STI status before you have sex with a new partner. If you don’t feel safe talking to your partner, find resources for getting help.

Not all sex has to be about penetration with a penis. Activities like mutual masturbation or using sex toys can be pleasurable and lower the risk of infection. Just be sure to clean your toys before and after each use. Another way to lower your risk is limiting how many people you have sex with.

Avoid skin-to-skin contact with other people who have rashes to lower your risk of infections like mpox and herpes. Rashes can look like pimples, blisters, or scabs. The rash could be on the genitals or anus, or other areas like hands, feet, chest, face, or mouth.

Using condoms consistently and correctly for anal and vaginal sex can provide a protective barrier against many STIs and HIV. Latex condoms offer strong protection, but non-latex options are available for people with allergies. Water- or silicone-based lube can help prevent your condom from breaking.

STIs can also be spread through oral sex. To lower your risk:

  • Use condoms or dental dams
  • Avoid oral sex if you or your partner have cuts or sores in your mouth
  • Maintain good oral hygiene

Substances like alcohol or other drugs can affect your decision-making in the moment. If you plan to drink or use drugs, talk with your partner ahead of time about boundaries and consent. If you inject drugs, avoid sharing needles, syringes, or other drug consumption equipment.

Vaccines can be a powerful addition to your sexual health routine. They can help protect you against:

Ask your health care provider which vaccines are recommended for you.

Many STIs don’t have noticeable symptoms. Getting tested regularly for STIs and HIV is the only way to know for sure—and early treatment can protect your long-term health.

  • Get tested every 3–6 months if you’re on PrEP, living with HIV, or have multiple partners
  • If not, get tested at least once a year

Find out what to expect when getting tested.

Post-exposure prophylaxis (PEP) is a medication that can prevent HIV. DoxyPEP is a medication that may help prevent bacterial STIs like chlamydia, gonorrhea, and syphilis. Both HIV PEP and DoxyPEP work best if taken within 24 hours of exposure and no later than 72 hours. These options can be helpful if you’ve had condomless sex and don’t know your partner’s STI or HIV status. Talk to your health care provider to learn more about whether PEP or DoxyPEP might be right for you.

Icon: Map Locator

Looking for sexual health services?

Find low- to no-cost sexual health services near you, like PrEP, STI testing, and more on the Service Locator Map.

Icon: Checkmark

Is PrEP right for you?

PrEP is a medication that helps prevent HIV. Take a short quiz to find out if it may be right for you.

Logo: Care That Fits You

Logo: Massachusetts Department of Public health

Brought to you by Massachusetts Department of Public Health Copyright © 2026

Logo: Care That Fits You

Logo: Massachusetts Department of Public health
Brought to you by Massachusetts Department of Public Health Copyright © 2026