Many times, just taking the gas cap off and putting it back on can solve the issue. The problem is there is some sort of "ventilation" issue that the engine sensors sense. When fuel is used, and the gasoline tank get lower, there is no air coming in and the engine works harder which makes the sensors trigger the light to go on. There could also be a sensor issue... or something else. We have no way to know for sure until the little code computer tool tells us the codes - but you can guess and try the easy stuff.
On the other hand, if the Check Engine light is not illuminating when the vehicle starts, then the bulb should be replaced
You get a garage to fix the problem that is causing the error and then reset the fault code.
If it stays off, replace the bulb. If it stays on, scan it for codes and fix the problems.
1996 and older the OBO1 scanner 1997 to today the OBO 2 scanner
Hope it helps
Lr
Have the code read and problem diagnosed/repaired by a trusted shop or dealership
You get it scanned at AutoZone or similar place,for code(s). Present those code(s), to a mechanic, and have him/her at it.
^