Researchers took a look at a common body function, flatulence, to learn more about it. Arising from a sincere desire to know whether a sterile environment like a surgical suite might be harmed by the fumes from a fart, the data revealed a lot.
We usually swallow air throughout the day, and that air has to be expelled from our bodies eventually. But a fart or flatus tends to come from the microbes that live in our gastrointestinal tract; after they break down molecules like sugar, gaseous byproducts are released. Those gases are not harmful, and they do not tend to include methane. Most people don't carry gut microbes that generate methane.
The bad smell of a fart comes from compounds that contain sulfur. You can learn more about these sulfur containing compounds from the video. There are not enough of them present in flatus for them to pose any danger to us. As for the microbes that might be released with the flatus, as long as clothing is worn they don't pose any threat to the environment.