Answer:
Don't be in the water! That's certainly the BEST way....
One of the tricks the Navy teaches in deep water survival training (DWEST) is to carry a black plastic 55-gallon "Leaf and lawn" garbage bag in your survival vest. If you're in the water, get into the bag. The bag is dark, opaque, and won't feel like food if the shark rubs against it, and the plastic smell hides your own taste. Plus, if you are injured, the blood will probably remain inside the bag and not spread out into the water. Sharks can smell incredibly faint traces of blood from miles away.
It's sometimes possible to use a stick or oar to block the shark and push him away.
I wouldn't try this unless I had no other choice, but at least a few people have hit a shark on the nose when it first investigated them.
Some divers carry a "bang stick"; a small club with a shotgun shell at the tip. If you press the shell against the shark, it sets off the shotgun blast. I don't recommend this, because the shark's blood will attract other sharks and put them into a feeding frenzy.
Most commercial "shark repellents" are worthless.