Do Masks and Respirators Prevent Viral Respiratory Illnesses?

A health professional told me back in March that face masks were ineffective but that respirators (the N95) were. Because of the source, I thought there must be validity to this. However, it seemed counterintuitive.