Condoms act as a barrier that prevents the exchange of bodily fluids, which is the primary mode of transmission for many STDs. Both male and female condoms are effective when used correctly. It's important to check the expiration date and ensure the condom is not damaged before use.