If your gas cap is just loose because you’re negligent, then it shouldn’t cost you anything to tighten it. What you do is, get out of your car and tighten it (when the vehicle is stopped). However, if your gas cap is damaged and needs to be replaced, you’re looking at spending a few bucks. A messed up gas cap situation accounts for over seven percent of the situations that a check engine light goes on, which is actually quite a bit higher than a lot of other reasons. You should hope, just hope, that the gas cap is the problem. A lot of other problems will hit your wallet much harder. We recommend you try tightening it first and then see if the light goes off.
If it's not your gas cap have this checked as soon as possible. If your check engine light flashes when driving, reduce the vehicle speed immediately until the light illuminates constantly. If it continues to flash, avoid heavy acceleration and high engine speed, stop the vehicle and have it checked immediately. Never ignore a continuing flashing check engine light! (In some vehicles, the light turns red.) If it is safe to do so, try stopping the vehicle, turning off the engine, waiting several minutes, then restarting the engine to reset the engine management system.