A variety of white blood cells play a role in immune responses against viruses and bacteria as well as cells that grow out of control and become cancerous.

Macrophages, neutrophils and other first responders provide the first line of defense, attacking invaders and releasing chemical messengers called cytokines that cause inflammation. Natural killer cells destroy virus-infected cells and tumor cells.

B cells and T cells, two types of lymphocytes, are more specialized soldiers of the immune system. These cells recognize specific proteins called antigens on viruses, bacteria and cancer cells.

B cells produce antibodies, which bind to antigens and either block viruses and bacteria from entering cells (neutralizing antibodies) or trigger additional immune defenses.

The two main types of T cells are CD4 and CD8 cells.

CD4, or helper, T cells coordinate the immune response. These are the primary targets of HIV. As the virus destroys CD4 cells, people become susceptible to opportunistic infections and cancers. Suppressing the virus with antiretroviral therapy protects CD4 cells, and monitoring CD4 counts—along with viral load—can show whether treatment is working.

CD8, or killer, T cells (also known as cytotoxic T cells) target cells infected with viruses or malignant cells. Unfortunately, killer T cells are usually not able to keep HIV in check without antiretrovirals, and cancer cells have ways to evade them.

After the immediate threat has been dealt with, a small number of memory B cells and T cells remain on guard, ready to fight the same invader again.

Vaccines mainly work by stimulating the production of antibodies, but they can promote T-cell activity too. Both antibody and T-cell responses play a role in fighting SARS-CoV-2, the new coronavirus that causes COVID-19. Checkpoint inhibitors, a type of immunotherapy, unleash T cells to fight cancer. Genetically engineered T cells, known as CAR-T therapy, are used to treat cancer and are under study for HIV.