I use a combination of natural navigation and compass headings. Depth contours are EXTREMELY useful -- noting the depth where the anchor is when you drop gives you a lot of information about where you are likely to find it again. If the site allows swimming that depth contour along the reef, that makes life easy. Otherwise, I pay attention to which direction I am going from the anchor line, and how much time I go in that direction. On the way back, I watch my time (knowing that I usually swim a bit faster coming home) and make sure I'm up at the required depth well ahead of time.
It can get VERY trick on sites where there is little contour, and there also aren't any clear lines of demarcation (kelp to sand, for example). I had an embarrassing dive off a Southern California dive boat, where I was teamed up with two locals. We dove a site with no contour, that consisted of a whole bunch of rocky ribs that all looked very much the same. I was tail-end Charlie, and happily diving along looking at critters, when we reached turn pressure and the lead diver told me I was now in charge. Gulp! I knew very vaguely where the anchor was, and I'll admit I fell over it rather than navigating to it with confidence.
It can get VERY trick on sites where there is little contour, and there also aren't any clear lines of demarcation (kelp to sand, for example). I had an embarrassing dive off a Southern California dive boat, where I was teamed up with two locals. We dove a site with no contour, that consisted of a whole bunch of rocky ribs that all looked very much the same. I was tail-end Charlie, and happily diving along looking at critters, when we reached turn pressure and the lead diver told me I was now in charge. Gulp! I knew very vaguely where the anchor was, and I'll admit I fell over it rather than navigating to it with confidence.