Vaccines all share the characteristic of priming the adaptive immune system to fight a microorganism by exposing it to a 'dummy' beforehand. We all know that the adaptive immune system has 'memory', and that it is therefore able to react better towards an invader the second time around. Vaccines exploit this.
Vaccines can be divided up as follows:
Killed (disabled) - this class of vaccines use whole organisms that have been killed beforehand (obviously!). The yearly 'flu vaccine is an example of a 'killed' vaccine. (Nitpick: the concept of 'killing' a virus assumes the virus was once alive, but not all microbiologists would agree with this.)
Attenuated - this group also uses whole organisms, but this time they let the poor things live. However, they are then modified so that they are unable to cause disease in us. The topical MMR (measles, mumps, rubella) vaccine is one of these.
Toxoid - if the organism elaborates a toxin that does most of the damage, it is possible to simply prime to body to fight the toxin itself, rather than the organism. This is what the familiar tetanus vaccine does.
Subunit - why use a whole organism when you can just use the antigenic bits? The hepatitis vaccine, or the HPV vaccine, for instance, use only the relevant parts.