The first thing to remember with a rip current is SWIM PARALLEL TO THE BEACH. If you remember that tip while in the water, you can escape any rip current. Instead of fighting the current, simply out smart it. Once out of the current, you can swim easily to the beach.
The ocean is very safe if you understand it. Here is some info on what a rip current is from our friends at NOAA.
Rip currents are powerful, narrow channels of moving water that are prevalent along the coastal ocean waters.
Panicked swimmers often try to counter a rip current by swimming straight back to shore—putting themselves at risk of drowning because of fatigue. This can be solved my remembering the above.
Lifeguards rescue tens of thousands of people from rip currents in the U.S. every year. Swim parallel to the shore and swim back to land at an angle.