Due to the process of fossilisation the older fossils are found in deeper layers (strata) of the earth, and the relatively younger ones are found on the surface. So by observing the layer of earth in which the fossil is present the relative age of the fossil can be found out.
Carbon dating:
Carbon-14 which is a radioisotope of carbon is present naturally in the atmosphere along with Carbon-12. This Carbon-14 is incorporated into the bodies of living organisms. After the death of the organism Carbon-14 decays at a constant and measurable rate. Measuring the amount of carbon-14 in the fossil can provide an accurate age of the fossil as the half life of carbon-14 is 5700 years.