I had this problem in my kitchen, always when I ran water, not at other times. Bleach helps, but only short term. I unscrewed the grey U bend bit, just underneath and gave it a good wash. Hair etc can start to clog in bathroom sinks, or if someone has happened to be sick in it (sorry) anything really can be in there stagnating. These Mr Muscle type sink and drain unblockers that foam when you put them down also help, but they are commercial and seem a bit of a rip off, someone might know a better home or trade remedy. Once sorted, a regular bleaching might help, and a hair catcher thing from the likes of Betterware.