how does vaccine help the body develop the immunity that it needs?
Vaccines work by activating the immune system in various ways to allow specific immune cells to gain "memory". With this memory, the immune system produces a more effective response to the pathogen on the second time around. This is just a general explanation that scrapes the surface. If you want specific details, don't be afraid to ask.
Usually a vaccine is composed of benign portions and/or quantities of the actual pathogens such as viruses or bacteria. Your immune system will be able to recognize the pathogen based on its previous exposure to the vaccine. Sometimes multiple doses of the vaccine are required over several months to ensure this memory is adequate. Your question is very broad, to the same effect if someone were to ask what is electricity.
thanks alot for the explanation
When faced with a new pathogen, your immune system tries out different antibodies that will be successful in fighting it (new types of antibodies are created in a kind-of evolutionary process). Once a successful anti-body is created, your body is prepared to fight the next invasion of that pathogen. A vaccine contains either something similar to the germ or a 'dead' form of the virus so that your body has a chance to figure it out without having you actually get sick (i.e., many live germs will do you in before your immune system can figure out a defense).
Separate names with a comma.