At sunrise and sunset, the Sun is very low in the sky, which means that the sunlight we see has travelled through a much thicker amount of atmosphere. ... The shorter wavelength blue light is scattered further, as the sunlight passes over a greater distance, and we see the longer wavelength yellow and red light.
I hope it helps :)