@Pasta1vaccinations have been mandated since smallpox eradication was developed.
the 1918 flu pandemic had mandated vaccinations.
polio, and many other virus infections have been subject of mandatory vaccination.
ask yourself why/how smallpox was eradicated globally? how was the polio pandemic controlled so completely? why was tuberculosis eliminated from Aus but not other countries who didn't have mandatory vaccination?
each of these viral infections were terrible killers of people and survivors suffered long lasting health problems after they recovered from their illness. polio was particular because of the extreme lengths needed to treat children in the literal "iron lungs". very expensive to the state as well as lost productivity and severe legacy health problems.
smallpox vaccination started as a simple scratch with infected blood from a person suffering severe illness. due to the scientific method being applied the trials aided development of vaccination which worked by didn't cause adverse events. same with influenza vaccines. each advance in the method of vaccination has resulted from trials and begun with trials.
this is an easy to read explainer: -
https://www.science.org.au/curious/people-medicine/vaccine-safety-and-effectiveness-how-it-tested