IANAPlumber, this could somehow screw up your drains for all I know, etc., but here’s what I’ve done for stinky bathroom drains:
First, try lots of boiling water – several quarts at least.
If that doesn’t fix it, try dumping about a cup of dry baking soda down the drain (if that much won’t fit, stop when it stops going down) followed by enough hot, undiluted, plain white vinegar to wash it all through. It will foam a lot.
WARNING: the sink may back up during the process. Keep a plunger handy and make sure you have lots of vinegar to keep washing the soda down (a gallon of vinegar is nice to have around anyway, right?). You may need to stick a stick down the drain and wiggle it to get the soda to mix well enough with the vinegar if you’ve added too much soda at first – a wooden dowel is great for this; a chopstick is good too.
Be safe. Avoid breathing the hot vinegar vapors – run a fan or open a window, and don’t stick your face all up in there. Be careful not to get vapors or splashback in your eyes. Wear gloves, since the vinegar is hot.
The easiest way to heat vinegar is in an electric teakettle – it’s also good for getting water scale out of the teakettle, but rinse thoroughly before using it for anything else (unless you like sour tea).
Follow by running the tap as hot as it’ll go for 5 minutes.
Problem drains benefit from doing this every four to six months. Prevent problem drains by always running the water on hot a little bit after you use the sink for whatever (shaving, brushing teeth, etc.). It may feel like you’re wasting water, but you’ll probably make up for it by not having to do the vinegar blast (or call a plumber) later on.
I have a periodic issue where eventually little bits of soap/skin/hair/miscellaneous bathroom sink debris get into the little openings where the sink overflow goes back into the drain. Something begins to feed upon that, leading to a buildup of this extremely nasty grey/black soft boogery substance.
It does not smell nice.
I have tried a variety of ways to get it out of those little openings (baking soda & vinegar, bleach, boiling water, PineSol, soap scum remover, enzymatic drain cleaner) but nothing has worked better than a bit of wire (to scrape it out) and an old turkey baster (to squirt hot water on it and then use it as a suction device to scoop it out).
This flushes out a couple of good-sized hunks of awfulness. Once that’s gone I’m fine for many months.
I’ve used a cup of bleach to deodorize drains at my place. Seems to work well enough.
I use the baking soda/vinegar treatment for greasy problems in the drains before they get to actual clogs, although not in the quantities mentioned above.
I use about a quarter cup of baking soda with a quarter cup of vinegar. Then again, I try to get on these issues quickly, so it may be my problems aren’t quite the dimension as those experienced by other people.
A plumber gave us his advice for slow drains last year - regularly give them a flush with a sink full of hot water and bleach (fill the sink with hot water and bleach and then pull the plug) - do this for all the sinks in your house. He also recommended doing a load of laundry with hot water and bleach (no clothes) periodically to clean out the drains for your washing machine. I use this on my kitchen sink that gets stinky sometimes, and it clears the smell right up.