When the Earth was forming it was very hot. Most of the contents was liquid. Something that is more dense than another will separate and make a layer below the less dense material. Lighter elements, like Magnesium, are in the mantle. Sedimentary rocks can be used for a number of things.
Sedimentary rocks form layers or stratifications.
Each layer is layed down during a certain time period, so sedimentary rocks can be used to tell the geological record of an area. Scientist can tell when an organism lived through which layers its fossils are in. It's almost like looking back in time, pretty neat. Sedimentary rocks can also be quite beautiful. Take a look at this picture .