A rock is a consolidation of minerals. Rocks are the foundation of earth making landforms, soils, magma and many other things. Three rock types are recognised namely igneous, sedimentary & metamorphic.
All these rock types are in a constant cycle forming one rock to another. This means igneous can form metamorphic and sedimentary and the latter two can also form igneous and so on.
Original rocks formed from magma solidification (igneous) form the basis of other rock types. These rocks when exposed to the surface by erosion or uplift from tectonic movements are subjected to temperature and pressure changes, weathering and erosion. These processes breaks down the igneous rocks into residual debris.
The debris is transported by wind, water or ice and deposited into ocean, sea or lake beds. The debris is compressed, glued and cemented by organic mineral matter forming sedimentary rocks. This process is called lithification; which means conversion to rock.
The sedimentary rocks also weather down producing debris which can form other sedimentary rocks. When these rocks are transported beneath the earth's surface, they are subjected to great heat and pressure forming metamorphic rocks. These rocks can be pressurised by folding. In addition, if they melt, igneous rocks can form upon cooling.
The metamorphic rocks again can also weather down forming sedimentary rocks, subjected to great heat and pressure forming other metamorphic rocks or melt forming igneous rocks.
To summarise, a rock type can form other rock types or itself.