I really enjoy swimming in the ocean
Swimming is among the top public recreational activities.  I hope you swim where there is a lifeguard!
I try too, one time I saw a shark while swimming
Be careful.  Although lifeguards are rescuers, they can't protect you from sharks.
what is the best protection from sharks?
Probably the removal of sharks by fishing and seperation of people from sharks, like by nets.
aren't nets dangerous for other wildlife though?
Shark nets mesh size is usually large enough to avoid disruption to most sea life.
that's good, I feel it is important to protect wildlife
Yes, well consider, when you are swimming with sharks, you are the wildlife that needs protection.