Sedimentary rocks are formed by other particles getting compressed together by pressure. This is what creates a sedimentary rock.
Metamorphic rocks are changed by heat and pressure. This happens because of magma that is near by or pressure from overlying rocks.
Igneous rocks are created by magma cooling and becoming a solid. When it is a solid, it has become an igneous rock.