Don't believe the "AI destroys critical thinking" memes floating around.
Critical thinking is a muscle you can always decide to use - no matter if you're browsing online coding tutorials, StackOverflow forums... or just asking an AI model the best way to do something.
Trial and error, experimentation and effort... there's no better lesson than just building something.