Im learning this in school, and the answer is look for a "rock cycle" and that answers all questions like yours :)
by metamorfism of sandstone.
it is formed by both igneous and sedimentary rock.
They both are formed by intense heat. However, metamorphic rocks are formed by intense heat and pressure, while igneous rocks are just dried lava/magma.
By high pressure and temperature