In simple terms, contraception is any resource you use during sexual activity which decreases your likelihood of contracting or spreading an STI, or experiencing unwanted pregnancy.
Condoms are the gold-standard of contraceptives for people with penises. They provide a non-permeable sheath that encompasses the penis and creates a barrier to prevent semen from being deposited in one's sexual partner, and they also decrease the exposed contact area in which bacteria, viruses, and other STI-causing pathogens can be spread. They're not perfect, but they do a damn good job! Condoms are fairly cheap, can increase your sexual endurance by decreasing stimulation, and can often be acquired at no cost to you through health clinics and advocacy programs.
Other forms of contraceptives, such as "female" condoms (which are placed within the vagina rather than on the penis) are available for intravaginal sex. Apparatuses such as dental dams, though not widely adopted, are also available to make cunnilingus and analingus safer.
For folks with increased risk of exposure to HIV should also know about PEP and PrEP.
PrEP, or Pre-Exposure Prophylaxis, is generally taken as a daily pill and decreases your likelihood of contracting HIV significantly. Truvada, the most common medication used for PrEP on the market today, is estimated to be 99.999% effective at preventing HIV.
PEP, or Post-Exposure Prophylaxis, is not a daily medication. Instead, if you think you may have been exposed to HIV, go immediately to an urgent treatment center or immediate care center and speak with a medical provider. PEP, when started within 72 hours of exposure, is highly effective at preventing exposure from causing an infection.
While discussing HIV, it's important to point out that if you have a partner who is HIV+ but has an undetectable status, that means that their viral load is so small that it cannot be detected in HIV tests and cannot be transmitted to a partner. HIV is not a death sentence or punishment for bad behaviors, and individuals with HIV can still have fulfilling sexual lives with partners who are HIV negative without transmitting the virus. It's important to know your status and know about options like PrEP and PEP, but these shouldn't be reasons to ostracize HIV+ individuals. You're more likely to contract HIV from someone who thinks they are negative than someone who knows they are HIV-positive.