Sedimentary rock is formed through the weathering of existing rock into sediments by forces like weathering, erosion, and deposition. These sediments are then compacted and cemented into sedimentary rock over time. There are two main types of sedimentary rock - clastic sedimentary rock which is formed from compacted sediments, and chemical sedimentary rock which forms from minerals precipitating from water. Sedimentary rock can provide clues about Earth's history through features preserved in the rock like ripples, mud cracks, and fossils.