Lithification is the process by which sediment turns into hardened rock. There are three ways in which lithification can occur. These processes are called compaction, recrystallization and cementation.
It happens mostly in the subsoil.
I hope my answer has come to your help. God bless and have a nice day ahead!