Nothing can be more unsettling than to have the check engine light suddenly blare at you from your dash board. In an older car, it is likely an oil problem and that means pull over and check the oil at the nearest safe pull out.
In a more modern car, say 2 or 3 years old, it can be anything. There are some places like the Oil Stop in Eureka, that will plug into your car for free to see what the code says to better identify the problem. Sometimes it can be as simple as a loose gas cap.
If you don't happen to be near a place with a code reader and have checked the oil and it seems fine and didn't notice any broken or missing belts or steaming hoses, there is a simple check you can do to help ease your mind.
Take the negative terminal off of your battery. Wait for about 10 minutes and re attach it.
This should clear the car's computer and when you re start the car, if the light doesn't come back on, you're probably ok.
A friend of mine is an ASE certified mechanic and Mazda tech. He says there are false codes that trigger a dash light, all the time.
He wasn't the one that turned me on to this information. That was my nephew that just got married. He used to work for one of the big auto rental companies and said they would do this on the lot when they had a check engine light.
My mechanic friend didn't think it was a bad idea as the same thing would happen if you had a dead battery and had to change it. He felt like it was a safe way to check for false check engine light codes.
Basically, if the light doesn't come back on, there is probably no problem.
It is still recommended to bring this up next time you take your car in for service.
I have a 2007 Kia and have had 3 different incidents that set off the check engine light. Only one of those turned out to be an actual problem.