Even though the sun’s light may look white/yellow it’s actually made up from all the colours of the rainbow.
When sunlight reaches the Earth’s atmosphere it’s scattered by all the gas molecules and particles in the air. The light that is scattered more is blue because it travels in shorter and smaller waves, that’s why we usually see a blue sky.