Does it matter what sort of mask you wear?
Yes. Different types of mask offer different levels of protection. Surgical grade N95 respirators offer the highest level of protection against Covid-19 infection, followed by surgical grade masks.
However, these masks are costly, in limited supply, contribute to landfill waste and are uncomfortable to wear for long periods.
So even countries that have required the public to wear face masks have generally suggested such masks should be reserved for health workers or those at particularly high risk.