A Question as Old as Curiosity
Look up on a clear day and the sky is a vivid blue. It is such a familiar sight that most people never stop to ask why. A common guess is that the sky simply reflects the blue of the oceans, but that is not the reason. The true explanation lies in the nature of sunlight and the way it behaves when it travels through the air above us.
Sunlight Is Not Really White
Although sunlight looks white or yellowish to our eyes, it is actually a mixture of all the colors of the rainbow. Each color is a different wavelength of light. Red and orange have longer wavelengths, while blue and violet have shorter wavelengths. When all these colors travel together, we see the combined light as white. To understand the blue sky, you have to think about what happens to these separate colors when sunlight enters the atmosphere.
Scattering by the Air
The Earth's atmosphere is full of tiny gas molecules, mostly nitrogen and oxygen. When sunlight passes through the air, it collides with these molecules, and the light gets scattered, meaning it is redirected in different directions. The key fact is that this scattering does not treat all colors equally. Shorter wavelengths, like blue, are scattered far more strongly than longer wavelengths, like red. This process is known as Rayleigh scattering, named after the scientist who explained it.
Why We See Blue Everywhere
Because blue light is scattered so strongly, it gets bounced around the atmosphere and arrives at your eyes from every direction in the sky. So when you look up, you see scattered blue light coming from all over, which makes the whole sky appear blue. The longer wavelengths, like red and yellow, mostly travel straight through without much scattering. This same effect explains why sunsets are red: when the Sun is low, its light passes through much more air, the blue is scattered away entirely, and mainly the reds and oranges reach your eyes.
Source
This article was written using information from Wikipedia.