The magma cools and crystallizes to form the igneous rocks. Natural forces like water or wind may break these rocks, and carry away them into other places. These pieces are called as sediments. The sediments get deposited over each other, thus, forming the sedimentary rocks.