How are igneous rocks formed?

They are formed from cooled magma.

They are hot magma the moment it is expelled from a volcano.

They are formed over many years of pressure and heat within Earth.

They are formed from sediments that collected in ocean beds.