Masks help prevent droplets from people with COVID-19 spreading. No, they don't work 100% of the time, but they're way better than not wearing one. And what about social distancing? what about staying at home? Those help.
https://www.ucsf.edu/news/2020/06/417906/still-confused-about-masks-heres-science-behind-how-face-masks-prevent
https://www.mayoclinic.org/coronavirus-mask/art-20485449