Rocks can be igneous, sedimentary, or metamorphic. Igneous rocks such as granite form from cooling magma. Sedimentary rocks like sandstone form from compressed sediments and may contain fossils. Metamorphic rocks like marble and quartzite were once igneous or sedimentary rocks but were changed by heat, pressure, or fluids into another type of rock.