An inactive form of the pathogen is injected into the body. The body detects the antigens on the surface of the pathyogen and this triggers the white blood cells (lymphocytes) to produce antibodies to combat the pathogen. This means that, if the person comes into contact with the real live pathogen, then they can behave as if they have had the disease before, (due to memory cells and these antibodies). Different vaccines are needed for different pathogens. If enough people are vaccinated in a population, then the disease could potentially be wiped out.