The single most effective thing you can do to stay healthy while being sexually active is to use latex condoms for sex (whether vaginal or anal). All condoms are not made alike; men should experiment with different brands until they find the one they like best. When you put on a condom, pinch its tip as you unroll it (all the way down!) to prevent an air bubble from forming in the reservoir tip. For sex, you should then put some water-based lube on the outside of the condom for comfort, mutual pleasure, and to keep the condom from tearing during sex. Note that some men find that more sensation is transmitted to them if they put a drop or two of water-based lube INSIDE the tip of their condom before putting it on. Also, it's very important for men to hold onto the base of their condom as they withdraw (i.e. after becoming soft) so it doesn't slip off inside the vag or anal canal.
For a while, health experts were recommending that people choose safer sex products with Nonoxynol-9 (a spermicide) to protect against HIV transmission: scientific evidence resulted in this advice being formally retracted by public health officials in the year 2000, and unless you are using Nonoxynol-9 as a contraceptive rather than for HIV prevention it may be wise to cease using it entirely. It does not protect against HIV, or other sexually transmitted infections.
If a condom fails during vaginal or anal sex, the receptive partner shouldn't douche; if any Nonoxynol-9 contraceptive foam is handy it MIGHT help for him or her to insert it and leave it in for about 15 minutes in order to avoid pregnancy, and it would certainly help to immediately remove the condom from inside the vag or anus if it was left there. If unwanted pregnancy is a possible outcome of the condom failure, you should visit or call the Bay Centre for Birth Control in downtown Toronto to find out about emergency contraception that is available to you.
Remember that a new condom needs to be used for each new partner, and that condoms should not be reused. Also, if you're going to switch from anal sex to vaginal sex, you should put on a new condom to avoid causing vaginal infections (urinary tract infections).