My advice would be simple: Do not let AI write any single line of code for you! Tell it to point out errors and help you to fix them, so it is an actual learning experience. Whatever AI you use, you can probably change the system prompt or whatever to be a tutor who helps but does not solve problems, instead of a coding assistant, who does the actual work for you.