Vaccination is the most effective way to prevent measles, which is highly contagious and was once declared eradicated.