The sun emits light waves in all colors of the spectrum, with the wavelengths of each color vibrating at different rates.
The reds and yellows have a long wavelength. Since they’re traveling in straighter lines from the sun to Earth, they are covering more ground with less chance of interference. As a result, fewer of them get sidetracked by air particles, dust, and other stray molecules as they pass through Earth’s atmosphere.
The blues and violets, on the other hand, have the shortest wavelengths and vibrate very quickly. This makes them more likely to collide with the various particles in the atmosphere and bounce and scatter wildly in random directions.
What we see in a blue sky is an abundance of these scattered blue and violet colors. Although there is more violet than blue light in the mix, the blue is more visible to our eyes, so the sky looks blue to us.
At sunset, the sun’s light gets angled through more of Earth’s atmosphere than when it’s directly overhead. If you have trouble picturing this, pretend the inner part of an orange is Earth, and the peel is its atmosphere.
If you poke a pin straight through the peel, you might reach the orange in a sixteenth of an inch. But if you angle the pin as you stick it in, you might go half an inch before you pierce the skin.
Simply by adding more atmosphere, you’ve already added more air molecules, more dust, and numerous other random particles. Air pollution adds even more particles for the blues and violets to bounce off. As a result, most of the blues and violets get bounced away from our eyes, making sunsets look more brilliantly yellow and red.