Know when you've had enough fun. If you're tired or cold, or have been in the sun all day long, call it a day. It's important to remember that even dead jellyfish can cause irritation. If a tentacle is left on the skin, it will continue to irritate until removed. Apply vinegar, rubbing alcohol, or a paste of baking soda and water to the affected area.
Stings normally resolve within a few days.
If you do happen to encounter a shark, let him know you are NOT his lunch. Start yelling and hit him in the nose. Hopefully, he'll get the picture. Most shark-human encounters are a case of mistaken identity. Used under License.