How does a rock form?

It depends on the type of rock. By fire, heat (from magma and lava) are called ingenious rocks, erosion by weathering (sedimentary rocks), and metamorphic rocks, caused by heat, pressure, chemical reactions, etc.

,