The Finnish Divers federation still officially requires a lead between buddies if visibility is below something like 6m. It's not binding. The lead is about 2m, has a float secured at the middle and has big loose loops you use to make a loop around your wrist (easy to get off). You should hold the rope in your hand, but it's also around your wrist so you can't eaisily loose it.
We don't generally use them anymore, but it can be useful. I try to always keep one in my car because when you want one you really want it. It can help a green diver stay relaxed and focus on other skills when the vis is poor because he knows he can't eaisily loose his buddy (we may have nothing else but poor vis available for training) It can put the brakes on someone who thinks diving is a swim race; if SpeedyBoy won't slow down, just sit back and let the silly twit pull you around, it saves getting breathless and loosing the guy time and again. I also feel much better about a buddy rope if vis is poor and I'm paired with a green diver in the sea or over deep water. If something very bad should happen I've got no hope of finding anyone underwater in those conditions.
Many will be scandalized by the very idea of a buddy rope. The disadvantages and risks are obvious, PLEASE don't feel a need to tell me about them. I just mentioned it being in use and even officially recommended by some entity because I thought that would be new information.
Practising OOA situations with the help of a 3rd person can be a huge help in learning to maintain awareness and suitable proximity to your buddy. Have this third person occasionly give you/buddy an agreed "you are OOA"-signal. The signal means you must *immediately* (no extra breath) stop using (possibly even remove) your reg, find your buddy and start sharing air. The drill is worthwhile anyway but it will also teach you how far is too far and how seriously unpleasant "too far" can be.
Your original question was about getting lost underwater. You need to learn navigation by using a compass as well as other natural clues such as the terrain, the sun, the direction of the current. It's also a neat trick to occasionaly use the natural bottom to create a clue, such as stacking stones to know this is the very point where I turn and go up the wall to the boat. If conditions warrant it (black like the inside of a cow or vis below about 2m) I would tie off a reel or spool to the anchor line.