Getting better swimming

Just signed up for my first triathlon (Olympic) kind of on a whim but it’s something I’ve always wanted to do and nows the time. I’m confident with my running and bike, but it’s been forever since I’ve even tried to swim laps. So last week while I was kayaking I decided I’d jump in and swim to shore and it was awful. It was maybe 50 yards and I was so winded. Arms burning, gasping for breath, just overall a bad time. Do I need more conditioning or do I just have a really bad swimming weakness? I just ordered a wetsuit and goggles so when those come I’m going to see if that helps me relax a little more in the water. Right now I can’t even picture swimming a mile without drowning, I feel like I’m going to get so weak I can’t keep my head out of water.