Shark interactions, while rare, are of course dangerous and Tidelines has an article that includes some sound advice for avoiding such interactions:
https://tidelinesblog.com/2021/06/11/shark-bite-at-seabrook-island/
Sharks are considered apex predators, meaning they have few natural predators of their own. However, this status is frequently mischaracterized and sensationalized, especially in regards to human interactions. There are an average of 4 unprovoked shark-related fatalities globally per year. For perspective, it is estimated that humans kill approximately 100,000,000 sharks each year, largely to harvest nothing more than their fin. That's nearly 4 sharks per second. Since sharks are being killed more quickly than they can reproduce, the population of sharks and rays has declined by over 70% in the past 50 years and half of the world’s oceanic shark species are now listed as either endangered or critically endangered by the International Union for Conservation of Nature. Sharks are remarkably important to both ocean food webs and terrestrial ecosystems, as they help maintain a balance between the populations of their prey species and animals further down the food chain. Removing sharks from the equation creates a runaway predatory effect further down the chain, which would likely lead to the decimation of a variety of species, even potentially including the oceanic microorganisms that we depend on to create the majority of the oxygen we breathe.
Some tips from the aforementioned Tidelines article for avoiding shark interactions:
Swim close to the shore
Be sure to swim, dive or surf with others
Avoid swimming at dusk and dawn
Avoid wearing shiny jewelry in the water
Avoid areas where there are large schools of fish or dolphins
Avoid areas where animal, human or fish waste enters the water
Avoid deep channels or areas with deep drop-offs nearby
Avoid going into the water if you are bleeding or have open wounds
Look carefully before jumping into the water from a boat or jetty
Leave the water if schooling fish or other wildlife start to behave erratically or congregate in large numbers
If you see a shark, leave the water as quickly and calmly as possible and avoid excessive splashing or noise