The light itself is controlled by the car's onboard computer (Engine Control Unit or ECU). The ECU only turns off the light *after* it detects the problem has been fixed and a certain number of successful driving cycles have been completed.
Here's what you should do:
1. Find out the trouble code: The easiest way is to use an OBD-II scanner. These are relatively inexpensive and available at most auto parts stores. The scanner will read the Diagnostic Trouble Code (DTC) stored in the ECU, giving you a clue as to what's wrong.
2. Diagnose and fix the problem: Based on the DTC, you can attempt to fix the problem yourself (if you're mechanically inclined) or take it to a mechanic. Common causes of a CEL include:
* Loose gas cap: This is a frequent, easy fix. Ensure your gas cap is securely tightened. Sometimes, just tightening it and driving for a few cycles will reset the light.
* Oxygen sensor: A malfunctioning oxygen sensor is a relatively common issue.
* Mass airflow sensor: This sensor measures the amount of air entering the engine.
* Catalytic converter: This is a more expensive component to replace.
* Other sensor issues: Various sensors throughout the engine can trigger the light.
3. Clear the code (after fixing the problem): Once you've addressed the issue, you can clear the code using the OBD-II scanner. Many scanners have a "clear codes" function. *Only do this after you are confident the problem is resolved.*
Important: Simply disconnecting the battery for a short period might temporarily clear the light, but the underlying problem will remain and the light will likely come back on. This is not a proper solution.
In short, focus on *fixing the problem*, not just resetting the light. Ignoring the CEL can lead to significant engine damage. If you're unsure about diagnosing the problem, it's always best to consult a qualified mechanic.