Some of the worse smells come when people’s intestines can’t digest stuff properly. That produces a lot of gas! There are lots of compounds that cause the unpleasant smells – lots contain sulfur like Daphne says, but others contain nitrogen.The compounds that smell are a tiny percentage of farts – the majority is nitrogen or hydrogen, then carbon dioxide, oxygen and methane. None of those smell but one or two are flammable.
No, before you ask, it’s not a good idea to try and light your farts.