Vaccines are meant to increase the body's ability to fight off disease. Some form or segment of a microbe is introduced into the body. The immune system gets familiar with it, builds a defense against it, eliminates the threat, and keeps that threat on file in the event of a future encounter.
There are several types of vaccines that can be used, depending on the scenario.
Live, attenuated vaccines use a living microbe that's been attenuated (weakened) by passing the microbe through animal tissue many times so as to prevent it from actually causing disease. This type of vaccine is considered a good way to cause the immune system to remember this particular microbe, and to create immunity to it.
Unfortunately, it is possible for a microbe in this type of vaccine to mutate into a harmful form. And it is important to be aware that pregnant women, and people with chronic illness or weakened immune systems should not be given live vaccines.
Because they are live vaccines, they generally need to be refrigerated. This excludes live attenuated vaccines from consideration for use in developing countries where refrigeration may not be available or dependable.
Live, attenuated vaccines are used against measles, mumps and chickenpox.
Inactivated vaccines contain dead microbes. This is potentially safer than a live, attenuated vaccine, with no risk of mutation and no need for refrigeration.
But this also means that inactivated vaccines don't trigger as powerful an immune response as live vaccines will. This necessitates later doses called booster shots to maintain immunity.
Inactivated vaccines are used against cholera, diphtheria, hepatitis B, rabies and tetanus.
Subunit vaccines only contain the antigen rather than the whole microbe. This lowers the risk of negative side effects to the vaccine. Then the only challenge is to identify which antigens are most effective for immunity, so up to 20 antigens may be used.
The hepatitis B vaccine is a type of subunit vaccine.
Toxoid vaccines are used for bacterial toxins. The toxins are inactivated with formalin (a solution of formaldehyde and sterilized water) or with aluminum or aluminum salts.