The sun emits many wavelengths of light, all through the visual spectrum and more. Our brain and eyes evolved to absorb more of the yellow side of the spectrum, so we see the sun as yellowish white.
You will study more about this in class 12 physics.