Take a look at light through a prism and notice all the different colors that you can see. Light that looks white to our eyes actually is made up of many different colors. Each color can be thought of as a light wave with a different wavelength (or size). Within the small range of wavelengths (or colors) that we can see with our eyes, the shorter waves are blue and the longer ones are red. Colors such as green, yellow, and orange lie in between the blue and red ends of the visible spectrum.
When light comes from the sun, all these light waves of different wavelengths travel through empty space. When they reach Earth’s atmosphere, the light waves can interact with particles in the air like dust, water droplets, and ice crystals. Because of the extremely small size of visible light waves (less than one millionth of a meter), these light waves also interact the tiny gas molecules that make up the air itself. The light waves bounce off these particles just like you might bounce and get jostled in a busy hallway. As the light waves bounce in lots of different directions, we say they have been scattered.
Small particles of dust and pollution in the air can contribute to (and sometimes even enhance) these colors, but the primary cause of a blue sky and orange/red sunsets or sunrises is scattering by the gas molecules that make up our atmosphere. Large particles of pollution or dust scatter light in a way that changes much less for different colors. The result is that a dusty or polluted sky is usually more grayish white than blue.
Similarly, cloud droplets (typically 10 millionths to 100 millionths of a meter) are much larger than visible light waves, so they scatter light without much color variation. This is why light scattered by clouds takes on the same color as the incoming light. For example, clouds will appear white or gray at midday and orange or red at sunrise or sunset. In this way, clouds act as a screen on which nature’s colors are painted.