Using Condoms:
Condoms are an important tool in preventing the spread of HIV.
When
used consistently and correctly, condoms are highly effective in
preventing HIV. They are also effective at preventing sexually
transmitted diseases (STDs) that are transmitted through bodily fluids,
such as gonorrhea and chlamydia. However, they provide less protection
against STDs spread through skin-to-skin contact like human
papillomavirus (genital warts), genital herpes, and syphilis.

Although highly effective when used consistently and correctly, there is
still a chance of getting HIV if you only use condoms, so adding other
prevention methods can further reduce your risk.

Source: AIDSgov