A mask does work in the sense of reducing your transmission to others if you are infected (and may not know it), by keeping your moisture-laden exhalations confined.
A mask can reduce your risk by reminding you not to touch your face after having contacted potentially infectious surfaces.
And there are different types of masks. Simple cotton patches aren't what the medical establishment needs, they don't filter micron-size virus particles. There are surgical-grade masks that do, and that's what medical workers need.