Immunity refers to the body's innate ability to fight off diseases. The immune system does this by fighting off pathogens, which can range from molecules to parasites. In order to do this, there are two main levels to immunity.
The first level is called the the innate immune system. This provides a quick first line of defense, and acts against a wide range of pathogens. The innate immune system is comprised in part by physical barriers such as the skin, nonspecific chemical defenses such as lysozyme (an enzyme secreted in various secretions such as tears and saliva that breaks down bacterial cell walls), and the normal flora, which are nonpathogenic bacteria that compete for space and resources with pathogenic bacteria. If a pathogen circumvents these defenses, it will then face the inflammatory response which can attract immune cells to the site of infection and dilate blood vessels to help ferry them there. Interferons can also be released which help fight viruses and tumors, and the complement system can attack the cell membranes of pathogens either disrupting them or promoting their elimination by other components of the immune system. Finally, various cells of the innate immune system can be activated. Phagocytic cells can engulf invading pathogens and destroy them upon ingestion, while natural killer cells can kill cells infected with a virus and tumor cells, and eosinophils can produce and release substances that are effective against parasites.
The second main level of immunty is called the adaptive immune system. This level takes time before responding to a pathogenic invasion, but once mobilized, it evokes a response specific to a particular pathogen, as opposed to the innate immune system, whose response is nonspecific. The adaptive immune system is also capable of remembering a specific pathogen, so that it can mount a more rapid, effective response to a pathogen which it has encounterd before. This is the basis of how vaccines work. The adaptive immune system is comprised of two main cell types: T cells (named because they were found in the thymus, the organ which they mature) and B cells (named for the bone marrow, where they are initially produced). Both kinds of cells are antigen-specific and are activated when they recognize an antigen of a pathogen. The two major types of T cells are killer or cytotoxic T cells and helper T cells. The former kill cells that are infected with viruses or cancer cells. They are also called CD8+ cells, since they have a co-receptor on their surface called CD8 that helps them recognize specific antigens. The latter help mount an immune response to a specific antigen in a multitude of ways, including the release of cytokines which help regulate parts of the immune system, and can mature into memory cells (which help remember a specific antigen) and regulatory cells (sometimes called Tregs for short, which help downregulate the immune response). Helper T cells are also called CD4+ due the the CD4 co-receptor on their surface. B cells make antigen-specific antibodies which can attach to pathogens and activate the compliment system more specifically, help phagocytes engulf the pathogen, or neutralize the pathogen by coating it.