Some light is scattered in all directions when it hits very small particles such as gas molecules or much larger particles such as dust or droplets of water.
The amount of scattering depends on how big the particle is compared to the wavelength of light that is hitting it. Smaller wavelengths are scattered more.
“Why is the sky blue?” is a common question. Light from the sun is made of all the colours of the rainbow. As this light hits the particles of nitrogen and oxygen in our atmosphere, it is scattered in all directions. Blue light has a smaller wavelength than red light, so it is scattered much more than red light. When we look at the sky, we see all the places that the blue light has been scattered from.
This is similar to the question: “Why are sunsets red?” When the Sun appears lower in the sky, the light that reaches us has already travelled through a lot more of the atmosphere. This means that a lot of the blue light has been scattered out well before the light arrives at us, so the sky appears redder.
Clouds appear white because the water droplets are much larger than the wavelengths of light. For this situation, all wavelengths of light are equally scattered in all directions.