How did scientists figure that the earth was made of layers?

Scientists used seismic waves to discover the layers of Earth.