A Vaccine is a preventive measure that either prevents one from getting infected by boosting their immune system or they can still get infected, but with greatly reduced symptoms.
Yes, that is my understanding of a vaccine. Similar treatment used to be administered in the form of inoculation, which could be an infected string litterally put in an open cut. This was not very controlled so it was much more dangerous than vaccine injections and often resulted in a full strength sickness. The advantage over just catching the sickness naturally was that you could get yourself properly prepared for it, and you could get inoculated out of season so that you wouldn't be sick at the time that all the doctors would be overwhelmed with work.
Vaccines were a much safer way to administer the same type of treatment, but they are getting more added to them over time than merely the disease we want our bodies to develop immunity to.