The answer would be an igneous rock. More specifically, if the magma cooled inside the Earth, it would be an intrusive igneous rock. If it cooled outside the Earth, it would be an extrusive igneous rock. This is because an igneous rock is formed from the cooling of magma, or molten material. Intrusive rocks are formed beneath the surface of the Earth, and extrusive igneous rocks are formed on the Earth. I hope this helps!