The rock cycle is a concept among geologists that explains the transitions of rocks between the rock types (igneous, sedimentary and metamorphic across geological time. It helps us illustrate the relationships between different rock types and how they change into each other. Note, before looking at the following diagram that the rock cycle is unlike other cycles, in fact it is not even a cycle. The types do not stay in equilibrium and if only changes as the environment makes them.
As you can see on the diagram there are many ways in which rocks can change form. These include exposure to the elements, which can affect rocks of all kinds, lithification, which is when sediments become solid sedimentary rock, and melting, consolidation and crystallization, which take rocks in and out of their base form, magma (or lava).Rocks melt into magma,and consolidate and crystallize into rocks. All rocks started from magma, and igneous rocks were the first to form. These gradually become other rocks types.
Sedimentary rocks form from sediments pressurized into rock (lithification) and the sediments used are usually from the eroding of other rocks. To fit this into the geological timeline we are going for, let's assume they are igneous. The weathered igneous rocks become sediment and were pushed up, say, a river until being buried and lithified.
Metamorphic rocks are formed via other rocks becoming altered due to pressure or temperature. This can include igneous, sedimentary or even other metamorphic rocks.