A drain that is used only occasionally can smell because the water in its P-trap has evaporated. The trap normally holds water that blocks sewer gases from entering your home. Run water into the drain to refill it, and do this regularly if the fixture is rarely used.
Refill the drain trap
Run the tap or shower for about a minute, or pour a few cups of water into a floor drain. For a seldom-used fixture, repeat this every week or two, especially in warm or dry conditions when water can evaporate faster.
If you will be away for a while, refill the trap before you leave. For a drain that is rarely used for long periods, a plumber can advise whether a suitable trap-seal product is appropriate.
Clean the drain if the odor remains
If adding water does not clear the smell, the cause may be buildup rather than a dry trap. Remove visible debris and clean the drain opening and stopper with warm water and dish soap. For a sink, clean the stopper and accessible parts of the drain; for a floor drain, remove its grate if it can be lifted safely and clear away debris.
Do not mix drain cleaners or combine bleach with other cleaning products. Follow product labels, and avoid using harsh chemicals unless the product is specifically intended for your drain and plumbing.
When to call a plumber
If the odor returns soon after you refill the trap, or affects several drains, there may be a problem with a trap, a plumbing vent, or another part of the drainage system. A persistent sewage smell, gurgling, or slow drainage is a reason to have the plumbing checked. Keep the room ventilated while investigating, and contact a plumber if the smell is strong or does not go away.