Sunlight contains all of the colors of light equally which is the color white. Air molecules scattered these colors of light around and the blue light scatters about 10 times more than the other colors. It is this scattered light that we see.
During sunrise and sunset, the light passes through a much larger slice of the atmosphere. The blue light is scattered so much that the only light that makes it to our eyes is the longer wavelength colors like red and orange. That’s what gives us those pretty sunsets.