Fossils can be obtained by some processes like mining or drilling etc. Their age can be identified by carbon dating and relative method
-1
Jyotsna Prasanth answered this
THERE ARE 2 WAYS:
Relative method: As u dig into the earth, it is reasonable that the fossils u find closer to the surface are more recent than the ones u find deeper into the earth.
C-14 Dating method: By detecting the different isotopes of the same element in the fossil material.