Experts used to discourage parents from giving their toddlers official swimming lessons before the age of four. The reason for that is they often give a false sense of security; after all, few children under that age have the muscle strength to keep themselves afloat safely on their own. But now experts encourage informal swimming programs for toddlers to get them comfortable around water — and to help them understand its dangers. So that would be a good start.
Other than that, you should never leave any child unattended around a pool — even for "a second" or if you feel confident that they're a strong enough swimmer. Remember that flotation devices can be dangerous; they have the potential to cause drowning instead of preventing it. (Moms and dads sometimes skip the swimming lessons, opting for flotation devices as a replacement — so kids never really learn what it takes to keep themselves afloat. Kids become so confident from their water wings that they’ll jump into deep water without thinking — and without supervision.) And you may even want to install barriers or a pool alarm to be extra-cautious.