Sediments form from wethering and gather due to erosion, through ice, water, wind, and gravity.
With the sedimetns deposited, pressure forces the sediments to squeeze together, pushing water out resulting in compaction. ALong with this comes cementation, sedimetns stick together from clay or other minerlas. Sedimentary rocks are now able to form.
As time progressees these sedimetnary are buried deeper and deeper applying more and more presssure.
Additionally, the burial comes with increasing heat, both the extreme and pressure allow these sedimetnary rocks to form metamorphic rocks
As these rocks get closer to the core these metamorphic rocks will melt, forming magma.
When this magma is able to cool, it is able to crystallizes forming organized molecules
Later, a tectonic plat shift will happen causing an uplife bringhing this rock to the surface allowing this entire cycle to repeat.