Most puppies do not know how to use their back legs the first time they try to swim. Their back end sinks and they may panic and develope a fear of the water.
If you have a pool or a friend with a pool this is the best way to teach them.
Purchase a puppy size life vest. They are around $25.00
Put a collar and leash on the pup and the vest. Carry the pup into the shallow end of the pool and get them used to the water. Than try to get them to swim in a circle around you while you hold the end of the leash.
The vest will keep them afloat while they learn to use their back legs and they will not panic.
Than guide them toward the stairs so they know where to get out of the pool. Otherwise they may try to climb out the side and panic when they can’t get out.
Take off the vest and go back in the pool with your pup on the leash and see if they use their back legs.
If so, you and your pup should be good to go. If not put the vest back on and keep practicing.