How Sonoran Silkies is describing is the way is the way I did it. I used to be a lifeguard, and I used to teach kids how to swim. I've taught adults too. I had my daughter in the water, and swimming at 6 months old. ( We lived near the water. ) There are classes you can take at a local YMCA called water babies for that. For slightly older kids, I would recommend enrolling them in a local YMCA class. They aren't expensive, you don't have to be a member, and some YMCA's have it so the parents can take part also. It's a lot of fun, and less stressful for the parent sometimes. Especially, if a child is stubborn.
Sometimes being in a group of kids around the same age helps them learn better.
Blowing bubbles, hanging on the the side of the pool while floating on their stomach, I would teach them to kick. It was a game I used, get the swim instructor soaking wet with huge splashing kicks.
When I blew the whistle they stopped, and I was usually soaked, while they were laughing. Once they got the hang of that I would let them float on their backs, and have them kick. I would hold on to them, then slowly let go, they were swimming all on their own.
The smiles on their faces were priceless when they realized I wasn't holding on anymore. This was all done in the shallow end of the pool.
Redhen is also right, don't ever just throw someone in. It's an awful experience for the person being thrown in, and sometimes makes them so scared they won't ever go in the water again. It happened to my mother, and her siblings. They were thrown off a dock. She always told that story, so I'm sure it was traumatic for her.
Bluemoon