According to physics and common sense, anything you put between you and the cough-er is going to reduce the number of cough particles to reach you.
Anything will work with different effectiveness.
N95 > Surgical > Handkerchief > Covering your mouth with your hand.
CDC, US, and WHO are just so incompetent around this matter. If they didn't want N95 shortage, they could've told people to wear cotton washable masks. It was such a simple and effective solution that they couldn't think of.
Source: https://twitter.com/CMichaelGibson/status/123971835157384397... Scarf is ~50% effective relative to surgical masks. Though this is tested against influenza, it's still applicable to COVID