Your best shark deterent is yourself! Sharks can be compared to vicious dogs: If they sense fear they may bite you! When you are
confronted by a shark be bold and the aggressor.Sharks are not accustomed to aggressive behavior from their victims. The next best deterent is "There is safety in Numbers". The more divers in
the water the more hesitant sharks are to approach. On the other
hand, the more sharks (like dogs) there are the more aggressive
they are. NOW, SPEARFISHING adds a new dimension to shark
encounters! Placid sharks become aggressive with a wounded
fish in the water. Best advise here is a kill(stone) shot or rapid
dispatching your fish with a knife thrust in the brain by a sharp
narrow double-edged knife.
Contrary to good practice (or sense) I spearfish alone in the heavily shark laden waters of Fiji. Actually, no dive buddies available. There are some fishing spots where I no longer go
because it is rare that you will be able to boat a fish before the tax collector(s) take their bite (usually leaving nothing for the guy
that worked for it).
Back on the topic, I have used a shark pod (electronic devise mentioned in other posts) with mixed results. They seem to work on large species: tiger, hammerhead,etc. but are not reliable for
mob feeding in smaller species such as grey reef, whaler,etc. The
units themselves are not that reliable also. Realistically. in most situations it is several or more(mobs) of the smaller species that
are more danderous than a single member of a large species.
I have heard of two other deterent devices but have never used them. A Glock pistol(possibly lethal) and a discharge of bubbles from an old style CO2 speargun.regulator.etc.
REMEMBER: Sharks are very unpredictable and what works today might not work tomorrow.WHEN IN DOUBT, GET OUT!