Although we take this eternal reality of the universe for granted, there is a concrete logic behind the question that why does a clear sky appear blue all the time. Space itself has no color; it is just an extension of the black abyss and nothingness. The properties of sunlight make this world a colorful place to live in!
Light comes in every form and type of wavelength and frequency. It also gives a range of effects perceived as light. In essence, the light consists of 6 base colors of varying wavelengths, and their assimilation turns the light white.
However, these different wavelengths are absorbed by various components in Earth’s atmosphere. Thus, the white light is separated and assimilated while breaking down into numerous individual components. Mostly, the light with shorter wavelengths is absorbed, and the yellow light with large frequency is left behind to impart yellow color to the sun.
The same concept can be applied to find out the logic behind this blue sky. Blue light scatters throughout the sky, and its reflection and propagation make the sky look blue. This effect was documented in 1859 and is known as the Tyndall effect. John Tyndall, the founder of Tyndall effect, explained that the blue light tends to scatter 10 times more than the red light. This is why our sky has the majestic blue color.
In 1911, this theory was confirmed by Albert Einstein. His calculations determined that the light scatters due to the specific composition of this atmosphere. This scattering light is the source of our illusion that the sky is blue. While looking up into the sky, you can observe the true color of nothingness and the unending blackness around us.
When we look towards the sun during sunset, we see red and orange colors because the blue light has been scattered out while moving away from the line of sight.
You can also prove and test this concept using a simple setup. Take a transparent glass and pour in some water, soap, and make it all nice and cloudy. Take the mixture in a dark room, and point a flashlight towards the mixture. You will surely see a hint of blue color in the water. This phenomenon confirms that blue light strikes the most upon striking an obstacle.
You can research on sky’s apparent blue color here.