During the day (daylight) the sky has a blue appearance because the Sun’s light (white light) is made up of rainbow of colors (red, orange, yellow, green, blue, indigo and violet) of different wavelength. This means, all these different colors of light combine to give you what is called white light. When sunlight enters the Earth’s atmosphere, it collides with air particles that causes the scattering of sunlight around the sky.
The black sky at night that shows you the moon, planets and stars is due to the absence of the Sun’s light. The overwhelming effect of the Sun’s light reacting with the atmosphere blacks out (conceal) the blackness of the sky (outer space). This means therefore that because there are no scattered light to reach the eyes of an observer during the night (to conceal the viewing of outer space) we get a clear (transparent) view of space, which is black. So, the sky is black during the night because it is revealing outer space.