Vaccinations contain an attenuated (broken down) part or piece of a pathogen that is capable of causing a certain disease. The memory cells on the body can remember the antigen present on the cell membranes of the disease and prepare the antibodies to fight any foreign material that has that specific antigen. So, in simpler words, they help stimulate the body against specific diseases.
I hope I helped!