The governments have been into 'do not use masks, keep them for the healthcare workers'. Which is a valid argument considering that the healthcare workers need them more than us, and when there is a shortage of them, then the healthcare workers would be screwed (well, die, and then more people die).
Of course, masks help in not getting infected. Why do you think healthcare workers wear them in the first place? It surely is not to not infect the infected patients. The head doctor in South Korea said that masks are very important to not get infected, and even more important to not infect the others, and he showed surprise that people in the west do not wear them.
The shortage of masks is a fecking travesty. Unlike ventilators, it is easy to make them, and they are cheap. The governments had the entire February and a part of January to direct companies to make literally billions of maks. Of course, it wouldn't have solved the problem, but it would have been a part of the solution.