Fossils are not dated directly. The ages of igneous rocks can be obtained directly by radiometric dating, and the ages of the sedimentary rocks and fossils between two dated igneous rocks are obtained by interpolation. For example, if a Santonian (Upper Cretaceous) lava flow or ash bed is dated at 84.5±1.0 million years, and a Campanian (also Upper Cretaceous) lava flow or ash bed is dated at 76.0±2.0 million years, then a Campanian fossil ammonite or bivalve in the sedimentary rocks between the two lava flows or ash beds is between 76 and 84.5 million years old. As the ages of more igneous rocks are measured, and as the boundaries of geological stages are defined more accurately by their fossil content, a more nearly complete geological time scale can be built up, and the age ranges of different fossil species can be established more precisely.
If you want to learn more about radiometric dating and the geological time scale, and how the possible sources of error are dealt with, you can try googling on such words and phrases as 'geochronology', 'geological time scale', 'the age of the earth', how old is the earth?', and 'radiometric dating', or you can read books on the subject. 'The Age of the Earth', by Brent G. Dalrymple, is a good introduction.
If you want to understand the fossil record, you will have to learn about stratigraphy, and about biostratigraphy in particular; this is not my field, so I am afraid that I cannot give you much help here. However, if you are an Australian, you will find the Timescales Project within Geoscience Australia -
Biostratigraphy | Geoscience Australia - of interest.