1. Since the Earth has atmosphere it leads to scattering of white sunlight into its constituent colours. And since the blue light gets most scattered, the sky appears blue.
2. But in space, there is virtually no atmosphere so no scattering of sun light, thus for an astronaut sky appears dark.