Even knowing how to swim often produces over-confidence that can get you into trouble. I remember swimming across a large pond as a kid and that was so stupid of me.
I had good enough training at our local YMCA’s pool that I even did some swim instructing for a while. I’ve swum across a small lake when a bit younger (about 65 y/o) under calm conditions. (I float better after about age 55 than when I did as a skinny kid.)
Rivers, tho’, are much trickier / hazardous.