Blue light is scattered in all direction by the tiny molecules of air in Earth's atmosphere. Blue is scattered more than other colors because it travels as shorter, smaller waves. This is the reason of the sky appear blue.

In space, there is no atmosphere, and so no light get scattered at all.
Light from the sun is emitted in white colour (that is, including all coulours of VIBGYOR)
but during the time when rays of the sun are tangential to the earth surface, the red part of the light goes straight un-scattered due to its long wavelength.
but the blue part of the light scatters due to its short wavelength and reaches earth and we see the sky as blue,
In space there is no atmosphere so the astronauts see the sky as black
find the attachment
mark as brainliest if that helped you :)