Risk analysis, dude. Risk analysis.
Dive in shark-infested waters, either in low vis or while spear fishing, be prepared for the occasional shark encounter. Most of those encounters end well, with both the diver and the shark escaping unscathed. Some don't, either for the shark or for the diver.
In most waters, even the risk of bumping into a shark of a species which may pose a risk to humans, is negligible. You are at much higher risk of dying or being seriously hurt during your drive to the site than during your dive.
My personal philosophy is that if a wild animal is about my size or larger, or have sharp teeth/talons/whatever, I treat it with the appropriate amount of respect, try to keep a healthy distance and don't actively hang out on their turf. It has worked pretty well so far.
And if a large wild animal decides to take a closer look at you, perhaps even thinking about checking out how you taste, pure luck will usually decide the outcome of the encounter. Bear spray, a .44 mag or a spear gun can only make a marginal difference.