But why is the sky blue.
It turns out that light scatters as it travels though the atmosphere, and the blue component of sunlight has a shorter wavelength. Because the shorter wavelength has more energy then red or yellow, it scatters more and is hence more visible in the sky.
Of course the sky is not blue all of the time. For example at senset it turns to red and yellow. This is because the light is traveling though a lot more atmosphere and this means most of the blue has by then scattered away.
It is hard to image, but that if physics worked differently, instead of blue skys we could have red skys during the day.