Spacesuits keep the wearer at just the right temperature. Surprisingly keeping the astronaut cool is most important. The heat source is actually the astronaut’s body. On Earth, heat escapes us mainly by convection (which needs air), in space heat escapes only by radiation which is slow. Without a cooling system astronauts would be cooked by their own body heat in their suits. So astronauts wear an inner garments threaded with fine tubes, water lows through these to cool the astronaut down.
Above this is the space suit proper which is in deed made of many layers. The suit worn on the Moon was
Inner layers (keeps the air in): five layers (including nomex, abrasion liner and neophene-coated nylon)
Outer layers (protects the inner layesr): thirteen layers (rubber-coated nylon, 5 layers of aluminised Mylar, 4 layers of Dacron, 2 layers of aluminised Kapton film/Beta-marquisette laminate and Teflon-coated Beta filament cloth).
A space suit is like the perfect vacuum thermos. You put coffee in your thermos and very little heat escapes because there is a vacuum (not as good as the vacuum in space) inside the cup. Space suits are perfectly sealed up tight, and outside there is nothing (an almost perfect vacuum), so all the heat stays inside. Your body keeps producing heat, so you keep getting hotter and hotter!