system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: What causes the moon to occasionally appear yellow?
gpt
Think of white light being made up of all the colors of the rainbow equally. Since light from our Sun is essentially white, and our moon is dark grey (ie: no color), it reflects light back to us without any colors of light "lost". So it looks white. (To prove this to yourself, try shining a white-light flashlight on a black piece of construction paper in a dark room... the paper will look white). 

However, the light must pass through our atmosphere before it reaches our eyes. As the white light passes through our atmosphere, some of it is scattered in different directions, but not equally across all the colors of the rainbow (spectrum). In fact, colors that are on the "blue" side of the rainbow get scattered much more easily than the "red" side. So by the time the light has made it to your eye, some of the blue light has been scattered away. Now the light has more "red" light than "blue" light left over, so it appears more reddish. You may be asking yourself "where did the blue light go?" -- well it got scattered in all directions and makes the sky look blue. 

Ok, now to your question. The more air that white light passes through, the more blue light is scattered away, so it looks redder and redder. When you look at the Sun or Moon directly above your head, you are essentially looking through 1 "atmosphere" of air. However, since we live on a sphere, the closer they are to the horizon, the more "atmospheres" we are looking through. For example, when the Sun or Moon is just above our horizon, it is passing though nearly 30 "atmospheres" of air. That is a lot of blue light scattered away, which makes them both look much more red.

This effect is increased by other particulate matter in the air. So areas of heavy smog like cities or after volcanic eruptions, the Sun and Moon can look "redder" than usual.