As a senior developer: Experience. The output from ChatGPT isn't perfect, but it's good enough to point one in the right direction. The code it outputs is mostly garbage that a good developer would never put into production, but what it does fairly well is finding the relevant bits of documentation.
Example: Using a small part of a new, big, unfamiliar library. Rather than digging through the library docs, I can ask ChatGPT about it, which often points me to the relevant parts, which I then can still confirm in the official docs.