Once your immune system is trained to resist a disease, you are said to be immune to it. Before vaccines, the only way to become immune to a disease was to actually get it and, with luck, survive it. This is called naturally acquired immunity. With naturally acquired immunity, you suffer the symptoms of the disease and also risk the complications, which can be quite serious or even deadly. In addition, during certain stages of the illness, you may be contagious and pass the disease to family members, friends, or others who come into contact with you.
Vaccines, which provide artificially acquired immunity, are an easier and less risky way to become immune. Vaccines can prevent a disease from occurring in the first place, rather than attempt to cure it after the fact.