Vaccination involves injecting a dead virus into the body in order that the body can learn how to recognise and destroy the invading virus. If the live virus is later encountered, the body knows how to defend itself and does not get infected.
Before vaccination was invented, a method of immunising a person from smallpox was to take small samples of the disease, directly infect the person, and hope that the body learned to cure itself before the infection learned to kill the person.
In China, the method used was slightly smarter, but more uninviting. They would take the scabs of a person infected with the disease, dry the scabs, grind them up, then blow the dust up the nostril of the person to be variolated.
In a way, this is like the primitive method a lot of people still use today, where when a parent's child has chickenpox, they will hold a party for the child and invite the neighbours around, the thought being that if the child catches chickenpox early, then when it is cured, they will never catch it again, and will be inoculated against more dangerous diseases such as shingles.
In 1796, doctor Edward Jenner performed an experiment which caught public opinion. In a procedure that would have people up in arms today, he took some pus from a cowpox pustule on a milk-maid and inserted it into his gardener's son's arm through a small cut, deliberately trying to infect the 8-year-old boy with a dying cowpox virus (pus is the immune system basically drowning an invading particle), the idea being that a dying or dead virus might be just as good as the living thing for training purposes, and will be heavily weakened already.
Over the next few days and weeks, he subjected the boy to increasing challenges from various poxes, none of which took hold.
In celebration of the success of the experiment, the cow from which the cowpox was gotten was killed, skinned, and the skin was hung on the wall of the St George's Medical School Library, where it still hangs.
By experimentation he was able to show that cowpox and smallpox can both be vaccinated against from the same vaccination, and more importantly that the vaccination does not need to come directly from the source (the cow), but can be grown in a lab.
10 years later, he was given a grant of £10,000 from the king (worth £918,403.60 in 2017), and 5 years later, another £20,000 (worth £1,836,807.21 in 2017) after vaccination was confirmed by the Royal College of Physicians to really work.
Smallpox has existed since at least 10,000 BCE. During the 18th century, it was responsible for about 400,000 deaths every year, and for a full third of all blindnesses. It has been estimated that about 500,000,000 people died of smallpox during the 20th century.
But, because of Edward Jenner's experiment, we no longer die of smallpox. The disease was completely wiped out in 1979. Vaccinations work.