A pathogen is something that enters the body and can cause a disease by killing body cells, releasing substances that are harmful known as toxins or by interrupting homeostasis by upsetting the proper functioning of the body.
When a pathogen like a bacteria, virus, fungus or parasite enters the body, the immune system will begin to defend the body. First, nonspecific defenses like unbroken skin, saliva, tears, mucus try to trap or block the entry of pathogens. Next, the inflammatory response occurs if tissue is injured. This involves extra blood flow to the area along with raising the body temperature to produce a fever, another defense against pathogens.
The next line of defense are cells that will engulf and "eat" foreign cells. Phagocytes are important white blood cells that can kill invading pathogens by detecting foreign cells, then binding to them and eventually surrounding and engulfing them. Phagocytes can creep about the body and surround and engulf foreign proteins that are not recognized as "self" and don't belong in the body. Enzymes inside the phagocyte are used to break down and kill the pathogen. Remains of the pathogen are kept by the phagocyte to flag other immune cells to help recognize and fight that pathogen.
If all the nonspecific responses fail, specific defenses are launched against the invader in what is known as the immune response. Lymphocytes are white blood cells that include B cells and killer T cells. B cells produce antibodies that attack pathogens in the blood. The antibodies are proteins that recognize a specific pathogen-- (antigen or foreign protein) which they then bind to. Then, T cells, another white blood cell, track down and destroy the germ. Memory cells made by B or T cells after they have fought a pathogen remain in the body in the event the same pathogen returns. In that case, the body will have the ability to quickly respond--this is what is known as building active immunity.
Both phagocytes and lymphocytes are types of white blood cells whose different functions help to contribute to keeping the body safe from invading pathogens.