If you’re caught in a rip you need to;
Stay calm, don’t panic and just float to save energy.
Raise one hand to let everyone know you’re in trouble, preferably your weaker one, so you can use the stronger arm as a paddle along with your legs to help you keep afloat until help arrives.
Never try to swim against the rip, they move in all different directions so first work out which way the water current (rip) is taking you. Only then, if you are able swim left or right (perpendicular) to the rip.
If you are not being rescued a rip will often take you out to the back of the break. Aim to move towards whitewash in the waves as this may be a sandbank, the waves will also help push you back into the beach.