Condoms act as a barrier by preventing the direct contact of bodily fluids such as semen, vaginal secretions, and blood. This significantly reduces the risk of transmitting pathogens that cause STIs, including HIV, gonorrhea, chlamydia, syphilis, and human papillomavirus (HPV). By blocking the exchange of these fluids, condoms help to halt the spread of infections from one person to another.