Both are formed from the crystallization of minerals caused by the cooling of magma.
Intrusive igneous rocks cooled below the surface of the planet, however, and generallydisplay larger crystals due to the increased amount of time spent at mineral crystallization temperatures from the insulating effect of surrounding material.
Examples: granite, gabbro, diorite, peridotite.
Extrusive rocks are formed from magma at or above the surface of the planet, and generally display smaller mineral crystals, or no crystals at all, because of the rapid cooling environment in which they form. Chemically, an intrusive and extrusive rock could be identical, the only difference being the size of the mineral crystals they contain.
Examples: obsidian, rhyolite, pumice, scoria, basalt.
if it helps you then please give a thumps up