I just paid $110 for a mechanic to tell me my gas cap was loose!

The next time the light comes on just drive it into an auto parts chain store. They will pull error codes out of it for free. (This is not “diagnostic” work - but the error codes are called “diagnostic trouble codes” (DTCs).

Write down the exact codes (they look like “P1234”) and post them here.

If the light just stays on steady nothing disastrous is going to happen. If it starts flashing, don’t keep driving.

If a problem that set the CEL is fixed it will turn itself off after a certain number of drive cycles. (I.e. not right away but after a little while). The auto parts people can also use the code scanner to reset it.