Answer:
Igneous rocks are constructed due to the cooling and solidification of molten magma. For example, Granite, Basalt, and Diorite. This solidification or crystallization process can take place below the earth's surface or at the earth's surface. These are often known as the intrusive (when magma crystallizes at a certain depth) and the extrusive (when crystallizes at the surface) igneous rocks.
Before the crystallization of magma and turning into granitic rocks, the molten magma present below the earth's surface, heats up the surrounding country rock, resulting in the alteration of its constituent minerals and rocks. When this radiated heat from the magma is extremely high, then it slowly leads to the changing of a rock type into metamorphic rocks.