How did scientists collect most of their data about Earth's layers?

by observing the exposed layers of large canyons such as the Grand Canyon

by digging through layers of Earth to get samples

By studying seismic waves

by going into the deep tunnels that coal miners use to mine coal