There are two quite different usages:
1. Diminish the number of viruses that travel out of your mouth and land on the surroundings, there to be picked up by some passer-by.
2. Prevent viruses in your surroundings from reaching you.
AIUI the WHO and others have said quite loudly that masks don't work reliably for the second case.