Scattering of light: When light is passed from one medium to another, then a part of it is absorbed by particles of the medium, and some part is deflected in a particular direction. This phenomenon is referred to as the scattering of light.
When sunlight reaches the atmosphere of the earth, the rays from the sun get scattered in various directions due to the presence of different gases and particles in the atmosphere.
The waves with short wavelengths are scattered the most by these particles.
Since blue colour has the shortest wavelength in the visible light spectrum, it gets scattered more( due to Rey-Leigh scattering which states that the shortest wavelength will scatter most.) and hence, the sky appears to be blue in colour.
Thus, the colour of the sky is blue because the blue light is scattered the most due to its shortest wavelength.