Some fossils, called index fossils, are particularly useful in correlating rocks.
For a fossil to be a good index fossil, it needs to have lived during one specific time period, be easy to identify and have been abundant and found in many places. If you find ammonites in a rock in the South Island and also in a rock in the North Island, you can say that both rocks are Mesozoic.
Different species of ammonites lived at different times within the Mesozoic, so identifying a fossil species can help narrow down when a rock was formed.
Fossils are the remains of plants and animals that have been preserved in rocks.
Geologists have found fossils that are only a few thousand years old and others that are more than 600 million years old.