system
Given the following post, respond as if you're commenting on Reddit:
human
How do we know Uranus's atmosphere is made of ammonia?

I've often read about how Uranus's atmosphere is composed primarily of ammonia. This has puzzled me, since we have  never ever been to Uranus and probably never will be able to go, and it's also hard to wrap my head around the fact that the same substance used in household cleaning solutions is also the main component of the atmosphere of a remote planet in the outer reaches of our solar system. Can we tell just by looking at the color of Uranus's atmosphere? I'd imagine it's impossible to determine what a distant planet's atmosphere is made up of considering we've never actually gone there.
gpt
So first off, this is incorrect. 

About 80% of Uranus' atmosphere is hydrogen. Follow that with another 16% or so of helium, and then a few percent left over for methane, ammonia, water, and hydrogen sulfide, in that order.

Now, how do we know this? It's a combination of... 

- Spectroscopy. By analyzing the sunlight reflected by the planet, we can tell that various compounds that various compounds in the atmosphere absorb certain colors of light. This provides a molecular fingerprint for these substances...though some are actually really difficult to detect this way.

- Density analysis. We know how big Uranus is and we know how massive it is (Voyager 2 flew past in 1986 and determined both of these very accurately), which means we also know its density. We also have some knowledge of how density varies throughout the interior based on gravitational anomalies that were picked up by Voyager 2. We can build computer models and see how large a planet of 1 Uranus-mass of various composition ends up being, and what its density at each layer would be, and how closely that matches our observations.

- Some chemistry. We know from the above that Uranus is mostly hydrogen-dominated, which means that any other atoms will likely be hydrogen-saturated. Oxygen? Surround it with two hydrogens and you get water. Nitrogen? Surround it with three hydrogens and you get ammonia. Carbon? Surround it with 4 hydrogens and you get methane. Sulfur? Surround it with two hydrogens and get hydrogen sulfide.