Particles in the atmosphere tend to scatter visible light of the shortest wavelengths first, of which blue is perceived with particular clarity by one of our three color receptors. When the sun beams directly down at us, that means that there is one strong beam of whitish-yellow direct light (if you stare straight at the sun — but don’t…), and ambient blue light coming from all other directions.
During a sunset, sunlight must pass through a lot more atmosphere. The blue light is scattered first, and the longer wavelengths are scattered later, when they are more likely to be contacting the air from which the ambient light is refracting that you are perceiving.
Still confused? No? Ok. Great. My work is done. ;P