In short, there is no one ‘best way’ to teach children software, as the method is often determined by the ability of the child, and at what stage they are cognitively developed.
There is however a general agreement that children react positively to new stimuli, and that one of the main issues in teaching kids in any disciple is to maintain their attention.For this reason many dedicated applications have been developed with the aim of teaching core programming concepts within a gaming style environment.
A popular examples is Scratch, developed by MIT, and CodeCombat, directed towards older children. These applications have a proven history for teaching kids the basics of coding. Generally, these applications tend to skip computer science jargon and instead focus on teaching the basic principles of coding. The game mechanics are usually very simple, making the experience both enjoyable and educational simultaneously. A study in The Journal of Happiness Studies shows that happy kids perform better at school and that kids who perform better at school are happier.
When teaching kids, it is important that you let the kids ‘drive’ and allow them to engage with the code. Demonstration is not enough to learn effectively, and It is often necessary to give each child their own computer when teaching a class. Pair programming has also been shown to be useful in this case, where two students can help each other navigate through the more challenging concepts.
Of course the relationship a child has to programming will largely be decided on by the parents, who need to promote the child's interests and expose them to the tools they need to continue learning by themselves.