The inside of the Earth is very hot - hot enough to melt rocks. Molten (liquid) rock forms when rocks melt. The molten rock is called magma. When the magma cools and solidifies, a type of rock called igneous rock forms.
A river carries, or transports, pieces of broken rock as it flows along. When the river reaches a lake or the sea, its load of transported rocks settles to the bottom. We say that the rocks are deposited. The deposited rocks build up in layers, called sediments. This process is called sedimentation.