How do body reflexes like coughing and sneezing help prevent or fight infection?

your body knows when something is wrong so it trys to fight it before it spreads in the wrong places your body knows when it knows.. DONT QUESTION THE BODY MAN!