Energy that is scattered causes a change in direction of the light path. The amount of light that is being scattered is a function of the size of the particle relative to the wavelength of the light falling on the particle. Particles that are tiny compared to the wavelength of the light scatter selectively according to wavelength. While all colors are scattered by air molecules, violet and blue are scattered most. At sunset and sunrise, 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 of the blue and violet light gets redirected out of your line of sight, while much of the yellow, orange and red colors continue along the undeviated path between your eye and the sun. This is why sunsets often are composed of yellow, orange and red colors. To demonstrate the cause of blue sky in the classroom requires only a clear glass container, water, some milk and a flashlight. The beam of light from the flashlight will be difficult to see in the water. Milk contains tiny molecules of protein and fat which scatter blue light, but we must dilute the milk to see the effect.