Rocks are composed of one or more minerals, and can be classified into three main types: sedimentary, igneous, and metamorphic. Sedimentary rocks form from the compression of sediments like sand and pebbles, igneous rocks form from the cooling of magma or lava, and metamorphic rocks form from the alteration of existing rocks by heat, pressure, and chemical reactions. Some rocks like quartzite and granite contain multiple minerals, while others like gypsum and halite contain only one mineral.