Which is needed to turn an igneous rock or sedimentary rock into a metamorphic rock

Erosion and deposition
Freezing and cementation
Melting and cooling
Heat and pressure

Heat and pressure