To learn programming with ChatGPT, make it ask you questions instead of handing you finished code, because copying code that works teaches you almost nothing. So I'd use the Socrates prompt: it doesn't give you the answer, it asks one question at a time until you work it out, with a small hint if you're stuck twice. It's a pain, and it's the one that sticks. Then I'd explain my code back in plain words, the Feynman technique, and have it tell me where I'm winging it.
If you end up building with Claude Code, Anthropic's coding tool, it has this built in. Its output styles docs describe a Learning style where Claude explains its choices and leaves small pieces of code for you to write yourself, and you switch to it with the /output-style command or the /config menu. That's a nice middle ground, because the job still gets done and you still write the hard part. I'd start with the first-principles prompt, though, so you know what's actually true about the thing you're building before you write a line. The prompts are in my guide to the six learning prompts.
More questions on this
Part of: Contractor Marketing, the full guide, with every related question linked.