Vaccines play a crucial role in public health by preventing the spread of infectious diseases. They work by stimulating the immune system to recognize and fight pathogens without causing the disease itself. This not only protects vaccinated individuals but also contributes to herd immunity, which protects those who cannot be vaccinated, such as newborns or individuals with certain medical conditions.