There is quite a bit of literature about off smells / flavors in beer but reading about them is quite different from interpreting the off smell / flavor your beer has developed. Over time, if one has a keen palate / nose, and gets some training, things become easier. You start to identify cooked cabbage (DMS), buttery, sourness, rancid etc. Now you have to deal with it!
Buttery (Diacetyl) is quite easy to detect. Think butterscotch. The solution is also simple: keep the beer warm (20-22c) for a couple of more days and it will reduce considerably. Most times anyway.
Sourness: If you don't give yeast enough time to consume the by-products of fermentation or have over, over pitched, you are likely to get green apply flavors. Keep it on the yeast longer and it may get cleaned up. Unless it is an Acetobacter infection.
Rancid, fart-smelling etc.: But what to do when your beer starts farting? I had no idea. Read all about it in various books and homebrew websites but there was no real solution. Seems like, these smells are put out by yeast during fermentation. Somehow, the yeast hadn't finished fermenting even though all sugars had been consumed. I bottled the beers with some sugar and kept them warm: over 25c. In one day, all the off smells vanished!! Moral: Keep the yeast warm and happy and they will fix the flaws in your beer.