Chatgpt can provide you a great explanation of the how.
Oftentimes the explanation is correct, even if there's some mistake in the code (probably because the explanation is easier to generate than the correct code, an artifact of being a high tech parrot)
A wrong answer with good thinking is better than a correct answer with no explanation.