Sedimentary rocks are formed by sediment deposited in layers over time at the bottom of lakes and oceans. Metamorphic rocks are changed by extreme pressure and heat over time. Igneous rock is formed when magma cools and solidifies, either above or below the Earth's surface.