A few tips if a shark gets a bit too interested in you:
1. Leave the water- swim in smooth strokes and keep an eye on the shark as you do so. Keep your dive buddy near you.
2. If the shark is showing any "attack" poses (swimming fast/zigzag/up and down pattern at you, hunching, lowering of its pectoral fins), reduce the ways the shark can come at you by either a) having a reef or wall against your back or b) going back-to-back with your dive buddy and both of you ascending together, and getting into your boat. If you are diving, descend to the bottom for cover.
3. Do not continuously have dead catch on your person, as this does attract sharks. Let the catch go ASAP if a shark is getting in your personal bubble too much- your life is worth more than some dinner.
4. If a shark does rush at you, use your speargun to fend it off. This usually causes them to retreat, in which you should do the same thing. Places that are good to hit are the snout and gills.