Our body is packed with a natural defense system known as the immune system. When a pathogen or foreigh cell enters into our body, it sends signals to the immune cells to fight against the foreign cells to protect it from the disease or infection. But sometimes, our natural immune system is not capable of fighting against some deadly pathogens, however, at that moment our immune system is boosted by injecting serum and that serum is known as a vaccine. Now you have the answer to the question of what is vaccine.
Vaccines are substances which help in preparing the immune cells to fight against deadly pathogens by creating a memory of that pathogens. So immune cells are capable of fighting the pathogen even without having a real fight. So whenever a new pathogen attacks the body, our immune cells are ready to fight and that is why a vaccinated person never falls sick.

How vaccine works:
Now we know what is vaccine but how it works. So, there is a substance present on the pathogen which is responsible to trigger the infection in the body and that substance is known as antigens. On our immune cells, Y shaped antibodies are present to which these antigens bind and the antibodies perform their function to kill them. So during a vaccination process what happens is that some antigens are entered into the body to activate the immune responses against them. After entering the antigen into the body, our immune cells will remember them as invaders or pathogens and in future immune responses will trigger as soon as the pathogen enters the body. So basically vaccines help in creating a mimic environment for the immune cells.
It should also be noted that vaccines do not work for an individual, it works for the entire population. If the whole population is immunized once then the chances of pandemic decreases. This is because when a pathogen does not find any suitable host to replicate, it will die automatically after a certain period of time. This process is known as herd immunity.

Types of vaccines:
When injecting antigens into the body to produce antibodies against it, it is important to make sure that person does not get sick and there are many techniques for that. Due to different techniques, there are different types of vaccines such as:
Live attenuated vaccine: For these vaccines, a weak or asymptomatic strain of virus is used which cannot cause sickness but immune cells can recognize it as antigen.
Inactivated vaccines: Pathogens are killed with chemical or heat treatment but our immune cells can fight against it.
Conjugate vaccines: specific proteins or carbohydrates are isolated and injected into the human body against which the immune cells show responses without causing sickness.
So this is all about what is vaccine, how it works and the types of vaccines.