What must happen before an igneous rock can form
The magma has to cool. At the rate, chemical composition and temperature at which the rock cools determines what rock forms.