The Sun appears white when viewed from space because it emits light across the entire visible spectrum. However, when observed from Earth, especially during sunrise or sunset, it can appear red or orange. This color change is primarily due to the scattering of sunlight by the Earth's atmosphere.
During these times, the sunlight has to pass through a thicker layer of the atmosphere, which scatters shorter wavelengths (like blue and green light) more effectively than the longer wavelengths (like red and orange). As a result, the direct sunlight reaching our eyes is predominantly red or orange, giving the Sun its characteristic color during those times.
In summary, while the Sun itself is essentially white, it can appear red under certain atmospheric conditions.