Astronauts use white spacesuits when they go on spacewalks to do work outside the space shuttle or International Space Station. White was chosen for a few reasons. One of the most important reasons is that white reflects heat so that the astronaut doesn't get too warm. Astronauts can get too cold as well, but that is usually in their hands. Therefore, the spacesuits have heaters in their gloves.
Another reason spacewalkers use white spacesuits is that white is visible against the black background of space, so other astronauts can easily see the spacewalker. In addition, since spacewalking astronauts always go out in pairs, one of the suits always has red stripes in four places so the other astronauts can tell one spacewalker from the other.
Inside the spaceship, astronauts get to wear clothes more like those you wear every day, and they can even help pick the colors.