How HIV Is and Is Not Transmitted
HIV is a fragile virus. It cannot live for very long outside the body. As a result, the virus is not transmitted through day-to-day activities such as shaking hands, hugging, or a casual kiss. You cannot become infected from a toilet seat, drinking fountain, doorknob, dishes, drinking glasses, food, or pets. You also cannot get HIV from mosquitoes.
HIV is primarily found in the blood, semen, or vaginal fluid of an infected person. HIV is transmitted in 3 main ways:

Having sex (anal, vaginal, or oral) with someone infected with HIV

Sharing needles and syringes with someone infected with HIV

Being exposed (fetus or infant) to HIV before or during birth or through breast feeding
HIV also can be transmitted through blood infected with HIV. However, since 1985, all donated blood in the United States has been tested for HIV. Therefore, the risk for HIV infection through the transfusion of blood or blood products is extremely low. The U.S. blood supply is considered among the safest in the world.
Risk Factors for HIV Transmission
You may be at increased risk for infection if you have..

injected drugs or steroids, during which equipment (such as needles, syringes, cotton, water) and blood were shared with others

had unprotected vaginal, anal, or oral sex (that is, sex without using condoms) with men who have sex with men, multiple partners, or anonymous partners

exchanged sex for drugs or money

been given a diagnosis of, or been treated for, hepatitis, tuberculosis (TB), or a sexually transmitted disease (STD) such as syphilis

received a blood transfusion or clotting factor during 1978–1985

had unprotected sex with someone who has any of the risk factors listed above.
Preventing Transmission
Your risk of getting HIV or passing it to someone else depends on several things. Do you know what they are? You might want to talk to someone who knows about HIV. You can also do the following:

Abstain from sex (do not have oral, anal, or vaginal sex) until you are in a relationship with only one person, are having sex with only each other, and each of you knows the other’s HIV status.

If you have, or plan to have, more than one sex partner, consider the following:

Get tested for HIV

If you are a man who has had sex with other men, get tested at least once a year.

If you are a woman who is planning to get pregnant or who is pregnant, get tested as soon as possible, before you have your baby.

Talk about HIV and other STDs with each partner before you have sex.

Learn as much as you can about each partner’s past behavior (sex and drug use), and consider the risks to your health before you have sex.

Ask your partners if they have recently been tested for HIV; encourage those who have not been tested to do so.

Use a latex condom and lubricant every time you have sex.

If you think you may have been exposed to another STD such as gonorrhea, syphilis, or Chlamydia trachomatis infection, get treatment. These diseases can increase your risk of getting HIV.

Get vaccinated against hepatitis B virus.

Even if you think you have low risk for HIV infection, get tested whenever you have a regular medical check-up.

Do not inject illicit drugs (drugs not prescribed by your doctor). You can get HIV through needles, syringes, and other works if they are contaminated with the blood of someone who has HIV. Drugs also cloud your mind, which may result in riskier sex.

If you do inject drugs, do the following:

Use only clean needles, syringes, and other works.

Never share needles, syringes, or other works.

Be careful not to expose yourself to another person's blood.

Get tested for HIV test at least once a year.

Consider getting counseling and treatment for your drug use.

Get vaccinated against hepatitis A and B viruses.

Do not have sex when you are taking drugs or drinking alcohol because being high can make you more likely to take risks.
To protect yourself, remember these ABCs:
A=Abstinence
B=Be Faithful
C=Condoms
Symptoms of HIV Infection
The only way to know whether you are infected is to be tested for HIV. You cannot rely on symptoms alone because many people who are infected with HIV do not have symptoms for many years. Someone can look and feel healthy but can still be infected. In fact, one quarter of the HIV-infected persons in the United States do not know that they are infected.
HIV Testing
Once HIV enters the body, the body starts to produce antibodies—substances the immune system creates after infection. Most HIV tests look for these antibodies rather than the virus itself. There are many different kinds of HIV tests, including rapid tests and home test kits. All HIV tests approved by the US government are very good at finding HIV.
Additional Resources for Basic Information.
MedLine AIDS Tutorial (NLM)
HIV Infection and AIDS: An Overview (NIH)
The Evidence That HIV Causes AIDS (NIH)
How HIV Causes AIDS (NIH)
The Origin of HIV (NIH)
Glossary of HIV/AIDS-Related Terms (AIDSInfo)