In geology, a rock is a natural substance composed of one or more minerals or mineraloids. There are three major groups of rocks: igneous, sedimentary, and metamorphic. Igneous are formed when magma cools and solidifies. Sedimentary are formed from eroded fragments of other rocks plus sand or the remains of animals and plants. Metamorphic are sedimentary or igneous rocks that have been transformed by pressure or heat.