The best way to feel confident swimming in the ocean is to become a strong swimmer. If you have never had formal swim instruction, seek out a course before your trip to build strength and confidence.
Unlike a pool, the ocean can be choppy, and conditions ever-changing. Make sure you've done your research, reviewed safety precautions with your party, and keep in close proximity to a lifeguard at all times. For extra security, wear a lifejacket and approach swimming with caution.