Four things worth doing before you book anything — one of them is free and solves it more often than you would guess.
A check-engine light covers hundreds of possible codes, from "your gas cap is loose" to "your catalytic converter needs replacing." Before you book a diagnostic, a few minutes of triage can save you a wasted trip.
A loose or cracked gas cap is one of the single most common causes of an illuminated check-engine light, and it costs nothing to rule out. Tighten it until it clicks, then give it a day or two — some cars need a few drive cycles to clear the code on their own.
A steady light usually means "get this looked at soon." A flashing light means the engine is actively misfiring and continuing to drive can damage the catalytic converter — pull over and get it towed rather than driving it in.
Most auto parts stores will read the code for free, even if you don't buy anything there. It won't tell you the full story, but it narrows things down before you pay a shop for a proper diagnostic.
A code tells you what system triggered the light, not necessarily the root cause. "P0420" (catalytic converter efficiency) can be the converter itself, or it can be an upstream oxygen sensor that's cheap to replace. A shop's diagnostic time is what pays for that distinction.