People wear surgical face masks to prevent the spread of germs. In areas with extreme air pollution, people also wear face masks to protect from inhaling harmful particulates.
Typical surgical face masks are designed to block larger liquid droplets from passing out of and into the wearer's mouth and nose. Face masks are not designed to filter out small particles, so they have can have limited effectiveness against some of the germs transmitted by sneezing or coughing.
Viruses such as influenza that are transmitted on larger particles may be blocked with a face mask. In this case, a person with the flu should wear a face mask to reduce the risk of transmitting the virus to others, according to the United States Centers for Disease Control and Prevention.