If you go to high elevations, the sky directly overhead can be very dark blue or even bluish-violet. That is because there are fewer molecules to scatter light at higher elevations, so only the shortest of wavelengths experience the most scattering as you go up further into the atmosphere. If you continued upward even more, the sky would slowly turn black as scattering diminishes even more. Space is black because there are very few molecules to scatter light. At sunrise and sunset, the sunlight passes through more atmosphere than during the day when the sun is higher in the sky.
More atmosphere means more molecules to scatter the violet and blue light.
If the path is long enough, all the blue and violet light gets redirected out of your line of sight, while much of the pink, orange, and red colors continue along the undeviated path between your eyes and the sun. This is why sunrises and sunsets often are composed of pink, red, and orange colors. When more molecules are in the atmosphere than normal, say after a major volcanic eruption, the most spectacular sunrises and sunsets can occur. Dust and water particles reflect light just like gas molecules can, therefore having more molecules in the air cause more scattering to occur, causing even less pinks and yellows to reach your eyes. More oranges and reds reach your eyes in this situation leading to intense sunrises and sunsets.