If used correctly, condoms are extremely effective at preventing HIV, gonorrhea and chlamydia. Condoms prevent fluids from transferring between partners, so they are great at stopping these kinds of infections that are passed in body fluids. Condoms can be less effective at preventing STIs like herpes, warts and syphilis that are transmitted through skin-to-skin contact, but they still do give some protection by covering some (but not all) of the skin on the genitals that touches during sex.
Using condoms is a key part of having safer sex. We also suggest getting tested regularly, talking to your partners about getting tested, or going to get tested together when you start a new relationship. Lowering the amount of partners you have can also lower the possibilities of being exposed to an STI.
Hope that helps answer your question,