Sunlight is actually light waves of different frequencies. Some of these waves are part of the visible light spectrum (ROYGBIV), and therefore sunlight appears white, a combination of all the frequencies in the visible light spectrum. Light waves with lower frequencies appear more red or orange. Light waves with higher frequencies appear violet or blue. When sunlight shines down through the atmosphere, the particles in the air scatter the light waves of higher frequencies, therefore spreading the waves in different directions in the sky (This is why appears blue). The lower frequency waves reach our eyes mostly undisturbed.
Since sunlight has light frequencies dominant in yellow, that’s the colour we see.