How are fossils dated?
The main scientific methods for determining the age of a fossil are: relative dating and absolute dating.
Relative dating
Relative dating can also use other fossil specimens, called index fossils, whose age is known, as a reference point. This is considered an appropriate method because it is known that certain fossils could only form within specific time intervals. Primarily, common fossils with a wide geographical distribution (ammonites, trilobites, brachiopods, etc.) with clearly established ages are used as comparison points. For example, if a new, previously undiscovered fossil is found in a layer of sedimentary rock, and species of ammonites known to have lived approximately 80 million years ago during the Cretaceous period are found in that same layer, this implies that our new fossil is also approximately 80 million years old and dates from the Cretaceous period.
Relative dating can also use other fossil specimens, called fossil index, whose age is known. This is considered an appropriate method because it is known that certain fossils could only have formed in certain time intervals. Mainly, common fossils with a wide geographical distribution (ammonites, trilobites, brachiopods, etc.), for which the age is clearly known, are used as a term of comparison. For example, a new, never-before-seen fossil was found in a layer of sedimentary rock. Since species of ammonites known to have lived about 80 million years ago, during the Cretaceous period, were found in the same layer, this implies that our new fossil is also about 80 million years old and from the Cretaceous period.
Another relative dating method involves vertical correlation of rock layers. The Earth's rock layers were deposited sequentially, one on top of the other, over millions of years. Thus, if a layer of rock A lies on top of another layer of rock B, known to be 40 million years old, then rock layer A clearly was deposited after layer B, so it is younger than 40 million years. And if above rock layer A is layer C, known to be 20 million years old, then it is clear that rock layer A is between 20 and 40 million years old. Stratigraphy is a branch of geology that deals with the study of rock layers and the process of stratification.

Absolute dating
Absolute dating is used to determine the exact age of a fossil specimen or rock. There are several methods of absolute dating (tree ring dating, amino acid dating, etc.) but the most commonly used are radiometric methods. These methods use radioactive minerals found in rocks or specimens that have isotopes that decay at regular intervals, providing a much more accurate way to measure the age of rocks or fossil specimens. The best-known radiometric method is Carbon-14 dating, but this is more difficult to use on fossils because Carbon-14 has a rapid half-life of 5,730 years. Thus, Carbon-14 can be used to date specimens up to 75,000 years old, but not more.
Instead, the Potassium-40 isotope is most commonly used for fossils, as it has a half-life of 1.25 billion years and is found in abundance in rocks and minerals.

Why is relative dating used more than radiometric dating for fossils?
In many respects, relative dating, although not as precise, is practical and superior to radiometric methods for everyday application. First and foremost, it is much faster and more cost-effective – the approximate age of a specimen can be determined instantly by correlating it with the known age of the surrounding rock layer or other geological indicators, without additional expense or lengthy laboratory procedures.
Secondly, in many cases, fossil specimens and sedimentary rock layers cannot be dated directly using radiometric methods because they lack the necessary isotopes. In these instances, a combination of relative and absolute dating is used – the nearest feasible rock layers (typically volcanic ash or igneous layers) are dated via radiometric methods, and based on their ages, the age of the specimen or target sedimentary layer is bracketed and approximated.
And last but not least, relative dating is preferable for fossil specimens because absolute radiometric dating methods are destructive; a portion of the specimen must be sacrificed to undergo the laboratory testing required to determine its age (the sample size needed varies from test to test).
Sources: Australian Museum, Nature