Because no vaccine for HIV is available, the only way to prevent an HIV infection is to avoid behaviors that put you at risk for it, such as sharing needles and having unprotected sex.
Many people infected with HIV have no symptoms. Therefore, there is no way of knowing with certainty whether your sexual partner is infected, unless he or she has repeatedly tested negative for the virus and has not engaged in any risky behavior. You should either abstain from having sex or use male latex condoms or female polyurethane condoms, which may offer partial protection during oral, anal, or vaginal sex. Only water-based lubricants should be used with male latex condoms.
Although some laboratory evidence shows that spermicides can kill HIV, researchers have not found that these products are a reliable method of prevention.