A vaccine is a solution of weakened/dead pathogens that cannot cause disease. By injecting the vaccine (ie. vaccination) into somebody you are provoking an immune response from their body, so that they will be 'ready' (via memory T cells etc.) when the real infection comes. In most textbooks you should be able to see a graph of the difference in amounts of antibodies produced between primary and secondary infections. When the secondary infection comes, way more antibodies are produced to combat the infection, because of memory cells. Vaccination is just exploiting that property.
As for Pasteur, I cant really remember. I think he trialled vaccination on sheeps? I dont know...