Vaccinations, such as those for HPV and hepatitis B, play a critical role in preventing infections. The HPV vaccine, for example, can prevent the strains of the virus most commonly associated with cervical cancer. Vaccines boost the immune system's response, providing protection against specific pathogens.