Yes! A condom is effective and the best option to reduce the chances of you getting sexually transmitted infections or diseases through vaginal, oral sex, or anal sex.
A male condom can shield you or your partners from STDs by avoiding contact with bodily fluids that can carry infections (like vaginal fluids and semen). Because the condom covers the penis, it is effective against sexually transmitted diseases like genital warts and herpes, which are transmitted through skin-to-skin contact.
However, they are not completely effective against these infections since they do not cover all the skin.