Age of fossils found in rocks
Yes, there is some amount of circular reasoning in the statement: "geologist date rocks by the fossils they contain and date fossils by the rocks in which they are found".

However, that statement does not fully describe how geologists date rocks or fossils. Dating rocks by fossils is a branch of geology called "biostratigraphy". This is a non-absolute and a relative method of dating. You know that one fossils is younger than another, so you can be sure that one rock is younger than another rock given that they have those fossils, respectively. How old are they exactly? Based on biostratigraphy alone, this is an unknown.

The problem is solved using geochronology. Using radioactive decay to accurately and precisely date rocks. This is independent of fossils, but requires that the rock have to be dateable. This means that you need some kind of volcanic material (among other things) interbedded with the fossil bearing rocks. When you do that - you can be sure that a certain fossil formed at some exact point in time. Let's say 100 million years ago. Then you can use that knowledge to assign an age to rocks containing similar fossils where you do not have any rocks that you can date.

That said, new technological advances allow us to directly date fossils. One of the methods is using the Lu-Hf or U-Th-Pb systems on apatite - a mineral that forms teeth and bones. In cases where this method has been applied it showed that biostratigraphy actually works (unsurprisingly and to the dismay of creationists).