There are 100s of different kinds of rocks, and they are all made in a slightly different way. However there are three main types of rocks called sedimentary, igneous and metamorphic.
Sedimentary rocks are formed when other rock types are broken up into small pieces, maybe by water or air or ice, these tiny broken pieces are then carried by water or air until they are deposited maybe in a river or on a beach or in a desert. When these pieces are buried they are squeezed together to make a sedimentary rock such as a sandstone.
Igneous rocks are formed when molten lava erupts from a volcano and cools down, or if the lava doesn’t erupt and stays beneath the ground it is called magma. When magma cools down under the ground igneous rocks such as granite are formed.
Metamorphic rocks are formed when any rock gets very very hot or is put under lots of pressure and is forced to change into another rock, such as marble!