If I were to use ChatGPT to help me to understand the game engine would that illegal or is it like images or code
I would assume that it's not against the rules. They say "No AI-Generated Content", so as long as you're using it for your own educational purposes and not to make your game's story, assets, code, etc. then you should probably be fine.