My father taught me when I was small enough to not remember how or exactly when. He'd just hold me from the belly and I'd move my arms, I think, then he'd let go and I'd be swimming all by myself. The trick is not to panic. It's just water, it's not going to suck you in if you're in the shallows!