The greatest weapon human beings possess against infectious disease is vaccines. They are also one of the most cost-effective, because they prevent serious disease and therefore costly hospital and medical procedures.
The cartoon below by James Gillray, c. 1800, shows Edward Jenner, usually given credit for the procedure, vaccinating people, who are turning into cows. Although satire, the cartoon shows the fears the procedure aroused in many people.
Jenner (below) was the first to publicize it and get credit, a knighthood, and a ton of money from Parliament.
Before the use of "vaccine" an immunization using actual smallpox pus from human cases had been in use, in some places for centuries. Inoculation, or variolation, as it was called, was intended to induce a mild case of the disease and lifelong immunity. It was not always mild. It had a mortality rate of about 1% inoculated and it sometimes left ugly scars. Image below compares inoculation and vaccination effects on arms.
The natural disease, however, often killed 20% or more of the infected, which explains the attraction of inoculation, especially during epidemics. Its use had become widespread by the time Jenner popularized vaccination.
Public resistance to vaccination remained high in many countries for a long time. But access to it was a bigger problem, often because of cost or lack of health care infrastructure.