Just like you receive vaccinations in childhood for disease prevention, you need various vaccinations as an adult. The most common vaccination people take as adults is the tetanus toxoid (a vaccine!) You would have also received the COVID-19 vaccine to prevent COVID-19.
Vaccines train the immune system to fight diseases. When a vaccine for a specific disease is taken, the body recognises it as a minor infection. It generates antibodies and cellular immunity against that (the immune system training!). As and when the “real” infection arrives, the body is ready to fight it. This immune “memory “may last for a few years and may require some extra “boosters “occasionally.
Why do adults need vaccines? As people age, their immunity wanes, and various chronic diseases like diabetes and heart and kidney disease set in, which make people prone to new infections. Some infections like Herpes Zoster are common only in older ages and not in the young. For specific diseases like diphtheria and tetanus, immunity wanes as the person ages and repeated boosters may be needed. For influenza, the virus changes yearly; hence, annual vaccination is necessary to prevent infection from new viruses.
Since vaccinations involve a cost, people are sometimes hesitant to take them. But remember that diseases like polio and smallpox are not seen any more due to aggressive vaccination campaigns. The number of deaths due to influenza has reduced tremendously due to vaccinations, and many complications of pneumonia are rare. HPV vaccinations have reduced the risk of cervical cancers, and Hepatitis B vaccinations have reduced severe hepatitis and cirrhosis.