The sky is blue especially during bright days due to Rayleigh scattering. This scattering is the elastic scattering of electromagnetic radiation including light, by particles much smaller than the wavelength of the light. It can happen notably when light travels through gases or air. Rayleigh scattering of sunlight results in diffuse sky radiation, which is primarily the reason why the sky is blue and the sun look yellow.
As light travels through the atmosphere, most of the longer wavelengths just pass through straight away whilst some of the red, orange and yellow light, is affected by the air. Much of the shorter wavelength light, like the blue wavelength, is absorbed by the gas molecules, which is then radiated in different directions. It scattered all around the sky and so the blue colour seemed to occupy much of the sky.