But how do they know how old things are?

Archaeologists and geologists like to know how old certain things like rocks, pottery and bones are. By estimating their age and origins, it helps them understand how they fit into broader contexts. But how do they do it?