They do both. Either prevent the disease, or make it less severe and shorter lasting by having your immune system trained in all instances for the possible infection.
We seem to have a lot of "new" definitions of what a vaccine is and is not in order to fit a certain narrative as of late.
Vaccination is the process of introducing a vaccine into the body to produce immunity to a specific disease. Vaccines are usually administered through needle injections but can also be administered by mouth or sprayed into a nostril.