Science tells us vaccines are one of the greatest inventions of the last 150 years. They've all but eradicated deadly diseases like smallpox, polio, and measles from most of the world.
Vaccines are a treatment designed to arm a person against those viruses and other diseases by providing immunity. They work by exposing you to a weakened version of a pathogen, like a flu virus. Your body's immune system then learns the pathogen's characteristics and develops the necessary antibodies to resist the pathogen if later exposed to it.