There are two methods:
i. Relative method when we dig into the earth, the fossils we find closer to the surface are more recent than the fossils we find in deeper layers.
ii. By detecting the ratios of different isotopes of the same element in the fossil material.