Some of the layers protect astronauts from the temperature, which can really hot and really cold.
Some layers protect them from micro meteorites that could fly into you at very high speeds, such as a material called Kevlar, which is almost bullet proof.
Some of the layers of the suit are even the radio antenna or metallic layers that make up the radio antenna.
All these different layers are tailored to you individually to make sure there’s a good fit.