Only certain masks are effective against viruses, because they are so small -— much smaller than dust particles, for instance.
I’m not sure any mask can keep them out except a gas mask.
Using the masks, even dust type, keeps you from touching your mouth and nose, which goes a long way to prevent the spread internally. A pair of goggles or safety glasses would also help to protet the eyes, as well as wearing gloves and washing your hands regularly.