Every sink, shower, toilet and appliance that uses water needs to have a p-trap. P-traps are there for the purpose of keeping sewer gasses out of your home. You will usually find them located underneath your sink in a cabinet using a “U” shaped pipe to keep a plug of water between you and your sewer. On appliances, the p-trap will often be built in on the drain pipe, often attached to the appliance itself.
Sewer gas is very harmful to humans, and not just because of the terrible smell. It can cause many health issues if you are exposed to it for a long period of time.
The standing water in a p-trap prevents gases from backing up into your home while letting water flow through.
Many p-traps have a drain plug that will let you clean it out, as well as dig out anything that washed down the drain by mistake.