Sedimentary rocks are formed by erosion and chemical actions.
Limestone from dissolved corals, Shale from cemented mud. Sandstone from cemented sand.
When small particles are formed by erosion or chemical actions the particles can form layers of sediments. If these layers of soft sediments are harder by chemical actions and pressure a sedimentary rocks occurs.