A literal interpretation of Genesis gives you an age of the Earth at around 6000 years. That's Bishop Ussher's analysis: others narrowed it down to October 4004BC.
For a long time that date was accepted as 'gospel'. The earth was seen as being essentially stable and unchanging, apart from Noah's Flood and a few lesser deluges.
But in the late 1700's canal and railway builders started digging up England and then Europe. By about 1810, 50 years before Darwin's Origin of the Species, it had become obvious that (a) the world had altered dramatically and (b) it had to be a lot older than a few thousand years.
The evidence was in the geology, on the surface, in cuttings for canals and railways, and down the coal and iron ore mines that were being dug to fuel the Industrial Revolution.
The first clue was glaciation. Early geologists could look at glaciated valleys in Switzerland, and see the marks that the glacier left behind - the gouging of the rock underneath and the piles of loose rock left behind when the front of the glacier melted. Surprisingly, these scrape marks and gravel piles (morraines) were all
over Scotland and the north of England. But obviously, from a long time ago, given the way it had been modified by later events: rivers digging channels through hard rocks, splits caused by earthquakes, and layers of soil over other parts.
Britain needed coal to heat the furnaces that made the steel that was a foundation of the Industrial Revolution. early geologists realized that the coal had once been plants and trees, mainly because of the fossil leaves and organisms that were sometimes found. They could see the intermediate stage of peat, and they figured out that the coal was peat that had been heated and pressed over a long period of time. The simple fact that the seams of coal were covered by thick layers of other rock meant that a long time had passed since it had been plants.
Then from 1750 onwards the engineers starting cutting through the hills for canals and from 1800 onwards, for railways. They saw different types of rock lying in layers. And the origin of the rocks were quite clear. They could see that some were soft sedimentary rock that must have been laid down on a river plain, because they contained fossils of land plants and animals. Curiously many of these were fossils of animals which no longer lived anywhere near where they were found, or which no longer lived anywhere on earth.
But when geologists mapped the layers of rock, they found that they weren't some random assortment; they were consistent over wide areas. They could see that large areas of South East England were covered with thick layers of chalk, which meant that it had once been under the sea for a very long time. In other areas there were layers of sedimentary rock which had been eroded off a mountain range - which was no longer there. And these layers were bent and deformed. (You can see the same thing here in places like Hatfields Beach where soft sedimentary rock has been twisted and contorted and in some places rock laid down flat, has been bent vertical.
To start with, geologists looked for an explanation that would fit with the Bible - could all this be explained by Noah's Flood? That hope went down the drain when they found examples where several different types of rock were laid down in an 'impossible' sequence: marine sediments (chalk from calcite shells from millions of little sea creatures) underneath land sediments (with tree leaves etc) underneath a layer of volcanic basalt.
The evidence was so clear and obvious that by 1810 all the intellectuals - scientists and clergy (the two were often the same in Victorian England) had accepted that the Genesis date could not be literally true.
Bear in mind that this is 50 years before Darwin. It wasn't Evolution that showed Genesis to be incorrect, it was geology, simple stuff that everybody could see and that didn't need a degree or a microscope to figure out.
Relative vs Absolute Dating
Originally only way to figure out how old rocks were was by looking at the sequence - ie usually oldest rocks at bottom, youngest at top. This is relative dating.