A vaccine (named after vaccinia, the infectiuos agent of smallpox) is used to prepare the human's or animal's immune system to defend the body against a specific pathogen, usually a bacterium, a virus or a toxin. Depending on the infectious agent to prepare against, the vaccine can be a weakened bacterium or virus that lost its virulence, or a toxoid (a modified, weakened toxin or particle from the infectious agent).
The immune system recognizes the vaccine particles as foreign, destroys them and "remembers" them. When the virulent version of the agent comes along, the immune system is prepared for a fast strike, neutralizing the agent before it can spread and multiply to vast numbers. Mention immune memory cells and related stuff here
Many vaccines, though they are by far not as virulent as the "real" agent, have unpleasant side effects on the body, and have to be renewed every few years. A new attempt to avoid these obstacles of "classic" vaccination is DNA vaccination. The DNA coding for a part of a virus or a bacterium that is recognizable by the immune system is inserted and expressed in human/animal cells. These cells now produce the toxoid for the infectious agent, without the effects other parts of a weakened agent might have. As of 2001, DNA vaccination is still experimental, but shows some promising results.