Actually, the method they use to find out the age of the fossils is by the layer of Earth its found in. And guess how they decide which age each layer declares what's found in it? By the fossils in them...
There are multiple ways to tell how old a fossil is, one of which is extremely, pin-point accurate to almost the exact year, if not the exact year itself. It does involve which layer of earth it's in, which is a radiometric test.
Also, there are a vast amount of different tests with multiple styles and types of radiometric dating and ways we know how old the earth is, and it has very little to do with fossils. It has to do with clocks and timers we use regarding the decay of substances within materials in the Earth. Whomever told you Earth's age is based on fossils needs to get their face into a science book and out of the bible fiction.
We use this information on the age of the Earth and these tests to determine the age of things, including Fossils, which are pin-point accurate, many of which are millions of years old. As the great Lewis Black once said, take a Fossil, show it to a Christian, if they don't get it - throw it over their head.