Fossils are formed through a process called fossilization. It typically involves the burial of an organism in sediment, which over time hardens into rock, preserving the organism's remains.