Here’s a good article and video on how rip currents work.
This is actually useful to surfers as this is the easiest way to get out to the breaking waves.
Here’s the text:
Transcript
The water looks ready for a swim, but there may be a danger awaiting those who enter.
This potentially deadly force is the #1 safety threat at beaches – it’s called a rip current.
Rip currents are fast, powerful channels of water flowing away from the beach and out past the breaking waves. And before you realize it, you can get dragged out far from the shore.
They can be really hard to spot, so exercise caution fi you see the following:
a channel of churning, choppy water;
an area with a noticeable difference in color;
a line of foam, seaweed, or debris moving steadily out to sea;
and/or a break in the incoming wave pattern.
If you get caught in one:
Stay calm, don’t fight the current.
Swim sideways out of the current and parallel to the shore, then at an angle back to the shore.
If you can’t escape it:
Float or calmly tread water. The rip current will eventually fade.
Try to face the shore, wave your arms, and yell for help.
If you see someone caught in one, DO NOT try to rescue them yourself, instead:
Get a lifeguard or call 911.
Yell instructions.
And if possible, throw a life preserver or floatation device.
These things may help you save a life.
The ocean can be a source of fun and excitement, but you should always be careful of hazards that exist. Only swim at lifeguard protected beaches. Before your next trip to the beach, know how to spot a rip current and how to break the grip of the rip.