There is no set procedure, it's all a matter of judgment, based on the conditions. For example, imagine this scenario:
You go for a swim at your favorite beach, which is located along a coastline thats oriented North to South. That beach, slopes out perhaps 30-40 meters, where the bottom suddenly drops off, in effect goes from water that's chest deep, to a depth that's well over your head. For the past few days, a storm's been brewing well offshore, in fact, hundreds of miles offshore. You arrive at the strand, to see tall breakers booming ashore, and notice that while there are not too many people swimming around, there's plenty surfers out having a field day.
You wade in, and begin paddling out, and suddenly find yourself being tossed ashore in a heap by a breaking wave. Undaunted, you make your way out, determined not to get tossed ashore again. You soon find yourself in water that's chest-deep, except when the occasional breaker comes in, and lifts you several meters off the bottom. Tired of clowning around, you set out to swim back in. After a few minutes of effort, you find yourself tiring, and decide to stand up. That's when you notice that you're no longer in chest deep water, but have been carried out several dozen yards further offshore, by a rip-current. Following some one else's advice, you try swimming parallel to shore, only to find that you're still being carried further and further out. What do you do in this case?
This happens every Summer at our beaches in NJ. The tide travels north to south, and when combined with a storm surge (even from a distant Tropical storm), it results in some rather nasty rip tides.