To diverge a little from most of the answers which are about making games or something useful, I had trouble getting going on ANYTHING with that advice. I think I only started actually coding when I looked at projecteuler.com just because the problems started so contained and achievable. Before that I only tried to read a book and copied the code from that (this was a dead end for me). I realize some people hate this kind of exercise or find it boring and a grind, but for some people it is actually fun and if that's the case they should really take advantage of it getting started.
These days there's plenty of sites like leetcode where you don't have to set up anything at all and they can give you little bite-size problems that will make you learn the basics with a feeling of accomplishment.
Incidentally, if they decide they like these kinds of problems and want to become a professional programmer, spending some time on Leetcode or codeforces (later as it requires a little setup) alone can get them a good job these days. People around here dislike this fact but it is so useful if it turns out your child enjoys these kinds of problems.
These days there's plenty of sites like leetcode where you don't have to set up anything at all and they can give you little bite-size problems that will make you learn the basics with a feeling of accomplishment.
Incidentally, if they decide they like these kinds of problems and want to become a professional programmer, spending some time on Leetcode or codeforces (later as it requires a little setup) alone can get them a good job these days. People around here dislike this fact but it is so useful if it turns out your child enjoys these kinds of problems.