Wearing a N95 mask correctly and washing your hands consistently is _quite_ effective at protecting you (and others).
Wearing a nonsense cloth mask, not terribly well fitted, protects you a little bit but mostly protects others some.
In between those it varies.
Nothing does much if you're not washing your hands before touching your face.
People also ignore that initial viral load can be a lot lower from masks (depending) even if you do get infected, which can help with severity.