The sky appears blue because of the way the Earth’s atmosphere scatters sunlight. When sunlight reaches the Earth’s atmosphere, it is made up of short-wavelength blue and violet light, as well as longer-wavelength red, orange, and yellow light.
The shorter-wavelength blue and violet light are more easily scattered in all directions by the gases and particles in the Earth’s atmosphere, such as oxygen and nitrogen molecules, water vapor, and dust particles. This is because these shorter-wavelength lights have higher energy and are more easily absorbed and re-emitted by the atoms and molecules in the atmosphere.
On the other hand, the longer-wavelength red, orange, and yellow light are less easily scattered and are more likely to pass straight through the atmosphere. This is why the sky appears blue most of the time, because the blue and violet light is scattered and diffused in all directions by the atmosphere, while the red, orange, and yellow light pass straight through and are not as visible to our eyes.