My five year old asked me why the sky is blue rather than purple.
The sky appears blue to human observers because blue light from the sun is scattered in all directions by the gases and particles in the Earth's atmosphere. This process is called Rayleigh scattering.

When sunlight reaches the Earth, it is made up of many different colors of light, including red, orange, yellow, green, blue, indigo, and violet. These colors are all part of the visible spectrum. Blue light has a shorter wavelength and higher frequency compared to other colors in the spectrum, making it more susceptible to scattering. When the sun's rays reach the atmosphere, they collide with atoms and molecules of air, which scatter the light in all directions. Blue light is scattered more than other colors because of its short wavelength, so it reaches our eyes from all angles as blue light.

This phenomenon is also responsible for the color of the moon and some clouds. Clouds can appear white or blue due to the way that light is scattered by their particles. The same principle applies to the sky: the blue light from the sun is scattered in all directions, giving us a blue sky when the sun is high in the sky.