Dust masks, bandanas, etc., might be helpful in blocking large droplets from an infected person's cough or sneezing, but they do not block the inhaling and exhaling of airborn virus. N-95 masks do. It is incorrect to say masks do not work unless mask is defined. Is it anti-viral or not.
Initially health authorities said healthy people don't need masks. They said this, because there was only a small supply of N-95 masks, not even enough for the doctors and nurses treating Covid patients. They wanted what few protective masks there were for medical personnel.
Also, the medical authorities did not want criticism for taking no action despite two months or more advance warning from China that a serous problem was on its way to North America and Europe. The authorities made no effort to ramp up production of N-95 masks or to find a way to filter or air scrub AC and heating vents to block or kill the virus. They delayed stopping air travel to and from infected countries.
The failure of public health authorities lends credence to "conspiracy theorists" who see Covid-19 as an orchestrated phenomenon. It looks very much like Big Pharma and CDC, NIH, and WHO allied with Big Pharma welcomed a pandemic in order to make billions in profits from selling a cure and a vaccine. So far Big Pharma has produced neither cure nor vaccine. Many people have been sick, have had their health permanently damaged, and have died.