HIV is spread by sexual contact, especially anal, with an infected person, by sharing needles and/or syringes (primarily for drug injection) with someone who is infected, or through blood transfusions. The latter is not common in countries where blood is screened. Babies born to HIV-infected women may become infected before or during birth or through breastfeeding after birth.
The only foolproof method of protecting yourself from contracting HIV or any STD is abstinence. However, safer sex practices can help lessen your chances of contracting HIV or other STDs.
Preventing the transmission of bodily fluids between partners is key to preventing the transmission of HIV. Use a condom every time you have intercourse with your partner, including oral sex. When he performs oral sex on you, use a dental dam or plastic wrap to prevent the exchange of fluids, and use a condom when performing oral sex on him. (Kissing someone with HIV is safe, but if one or both of you has an oral sore, you should abstain from kissing until it heals.) Remember, all it takes is one incident of unprotected sex, so use protection every single time you are intimate. Keep in mind, a condom does not prevent the transmission of skin to skin transmitted STDs such as herpes, syphilis and genital warts.