What folks are saying here is true. Odds are you'll never have a problem with a shark, but sometimes sharks are aggressive with divers. Knowing how to act around sharks will help keep you safe.
Your best defense against sharks is to keep your wits about you. Sharks usually notice us before we notice them, then leave. When we're lucky, they ignore us and hang around so we get a good look, we rarely see them at all. Encounters with sharks that are not fun are extremely rare. You need to be aware that rare as they are, they do happen. Knowing how to react is important. Stay off the surface! Very few attacks (3.8%) on divers come from above. That's particularly significant when you consider most divers spend most of their time near the bottom. Present a stong confident image, swim gracefully, without using your hands. If you feel you're in danger at any time, swim underwater to the boat and get out of the water. Keep an eye on the shark. If a shark gets too close, yell or growl. You can't outswim the shark, so don't even try. A better option is to charge. If a shark is going for your buddy, charge it while yelling. Animals trying to swim rapidly away from a shark appear to be prey. You don't want a shark to identify you as prey. If you have to, push the shark away (or you away from the shark) or hit it on the nose or in the gills. Gills are my first choice, but sometimes you can't reach your first choice.
By the way, when you hang motionless it often brings a shark in for a closer look.