Index fossils are used for relative dating, because the fossils are only found in a short period of geological time. The index fossils are deposited at the same time as the sedimentary rocks around it.
If you knew an organism that is now a fossil is say 70 million years old, then you can assume that the rocks underneath it are older than 70 million years, the sedimentary rock that its found in must have been deposited 70 million years ago, and the rocks above it must be younger than 70 million years old.
Other forms of relative dating include:
- Law of superposition: younger rocks are above older rocks
- Original horizontality: sediments are not in vertical structure
- Lateral continuity: layers of sedimentary rocks extend laterally in all directions until they thin and pinch out.
- Cross cutting: a geological feature such as a fault is younger than any feature that it cuts.
- Inclusions: fragments of one rock within another, are older than the rock containing them.
- Fossil succession: fossils in rock layers at the bottom of a sequence are older than the fossils at the top.
I can't remember if you need to know all those ways of relative dating or not.