These ages have been derived from relative dating and absolute dating (radiometric dating) of rock layers and fossils.
(a) Relative Dating This technique uses principles of stratigraphy (rock strata) and the study of fossils (palaeontology) to determine the relative ages of rocks and sediments. Field geologists' rely on a number of simple techniques for dating rocks and constructing geological successions. The Law of Strata Identified by Fossils is a little bit more complex.
There are three main assumptions that must be made to accept radiometric dating methods.
Making this processes even more difficult is the fact that due to plate tectonics some rock layers have been uplifted into mountains and eroded while others have subsided to form basins and be buried by younger sediments.
Relative geologic age is established, based on such evidence as the order in which layers of sediment are stacked, with the younger layer originally on top.
By using the principles of relative geologic age, the sequence of geologic events -- what happened first, what happened next, what happened last -- can be established.
Long before geologists tried to quantify the age of the Earth they developed techniques to determine which geologic events preceded another, what are termed "relative age” relationships.
These techniques were first articulated by Nicolas Steno, a Dane living in the Medici court of Italy in the 17th C.