You can prevent whooping cough (pertussis) primarily through vaccination.
The most effective method to prevent whooping cough is through vaccination with the pertussis vaccine. This vaccine is frequently administered by doctors in combination with vaccines protecting against two other serious diseases, diphtheria and tetanus. Vaccination is recommended starting in infancy.