Hold the child beneath the armpits and walk him around in the water, get them to kick theor legs. Have him hold onto the side of the pool so you can guide his legs. Then do it with your hands beneath his armpits to develop the feeling of motion. Blow bubbles in the water with the child as he kicks to get him used to putting his face in the water. Gradually begin dunking him down to practice holding his breath. Support the, around their waist or chest and begin having them stroke with their arms. Demonstrate the motion yourself, and then guide the child's arms. Then let him do it on his own while you support him in the water. Have him keep kicking. Have the child swim a short distance from the wall to you. Gradually increase the distance and that should teach them!
Is the child afraid of the water?
If yes, then you have to get them used to the water and unafraid first. Best is to learn swimming in flat water where they can reach the ground with their feet.
My kids were extremely afraid of having their head under water, so you have to be very careful about that, and make sure they never panic when they sink.
Then you show them the motions they need to swim and hold your hands beneath them while they try. Never let them sink unless they want to. Until they are able to hold themselves up.
When they are feeling safer, let them swim short distances on their own, like between two adults who stand 3 yards apart. Or from the pool stairs to your arms. Or let them follow you while you slowly walk backwards.