N-95 masks can be with or without valves.
With the valve they are pointless if the werarer is positive/transmits the illness.
The valveless ones are fine, but both with valve and valveless are not as useful as they promise (filtering 95% or so) because the wearer must be trained to use them AND the masks need to be suitable to the wearer, after a proper "fit test" AND the wearer must be medically tested to be able to breath with reduced flow.
The exact method the fit test (and the medical check) is performed varies by country/norm, but check this:
https://www.osha.gov/video/respiratory_protection/fittesting...
https://www.youtube.com/watch?time_continue=559&v=D38BjgUdL5...
Basically you choose among 10-12 different models the one that seemingly fits better your face, then you put the mask on, a sort of transparent plastic hood is put over your head and a small quantity of substance is sprayed (usually vanilla or similar highly penetrating odour) under the hood, if you can smell it, the mask is not the proper fit or has not been put on properly and you start again.
Then, the particular model of mask with which you passed the test is "your" mask (and you won't use another model).
And of course you need to be cleanly shaved.
A "surgical mask" has a much lower filtering potential, but unlike the N-95 masks (FFP-2 in Europe) anyone can reach it without issues.