Sedimentary rocks are rocks formed by the deposition, burial and compression of weathered rock fragments. Examples are sandstone, mudstone and limestone.
The rock is cemented together by a combination of pressure, heat from radioactivity and minerals such as calcium carbonate and silica which is deposited by circulated water.
Many fossils are found in sedimentary rocks. Some fossils are actually part of a creature e.g. teeth or bones. Others are trace fossils e.g. footprints or burrows. But most are casts. Dead remains decay leaving behind a hollow that keeps its shape. This acts as a mould and fills up with deposited salts etc which harden to form the cast.
If you know when a species lived, its fossil will give you a clue about the age of the rock. Plants and animal species which were only around for a short time and their fossils can be used to date rocks more accurately are called. index fossils.
Limestone is formed when the hard parts of sea animals drop to the sea floor as sediment. These animals have removed calcium and bicarbonate ions from sea water to build their shells and skeletons of calcium carbonate.
Chalk is formed when algae (tiny single cell sea plants) die and the tiny castings made of calcium carbonate which they use for protection fall to the sea floor as sediment which forms chalk.