In most cases a shark would just be passing by. If you stay calm then the shark might continue on its path and leave you alone. Sharks don’t usually attack humans for no reason.
Drop your catch
If you have been spearfishing then drop your catch and slowly leave the place. In such a case, the smell of your catch might have attracted the shark. Leave the catch to the shark because there is a possibility that it came for it.
Go near your dive partner
Sharks are very less likely to attack groups of people and so by getting closer to your dive partner you are greatly reducing the chances of a shark attack.
Put your back against something
To reduce the possible angle from which a shark can approach you, keep your back against something if possible.
Keep your back against your partner
If you are in open water then keep your back against your other partner and you can then slowly try to rise and exit if the shark comes closer.
Hit it in the nose
Many people agree that the best thing to do in case a shark actually tried to attack you is to punch it in the nose. Punch the shark then leave right away because an aggressive shark might return back shortly. (See Why do sharks attack humans?)
When you swim do it as smoothly as possible, for additional noise can make the shark more curious as sharks are very sensitive to sounds.
Don’t play dead
According to many experts, playing dead won’t work as this won’t stop the shark from pursuing the goal it came for.
Attack the eyes
In case the shark gets you in its mouth try to aggressively attack its eyes. The shark’s skin is very thick but areas like its eyes are almost not protected.
Always keep watching the shark
Never give your back to the shark while swimming. This will prevent you from seeing it approaching and as a result it will decrease your chances of defending yourself. (See How to Evade a Shark Attack?)
Push with a pointed object
If you have any pointed hunting equipment then push it forward towards the shark’s face. This will make the shark go back before attempting to attack again.
Rise up between attacks
After you hit the shark rise up while looking at the shark, then as soon as you find it approaching again hit it again then repeat the process.
What's the Difference Between Rabbits and Hares? 8 Differences Between Rabbits and Hares.