To find out the cause of the check engine light being on you will need a scan tool. If you don't own one that is fine as a number of auto parts stores loan them out, or will even do the scan for you. For more information on scan tools see this post of mine. Once you have the code (they have the form of P####, B####, or C####) you will need to figure out what it means. Some scan tools will tell you, but if the one you are using doesn't then you can find out what it means by:
- Looking it up in a repair manual for your car
- Asking the clerk at the auto parts store
- Looking it up online
I do like asking the auto parts store clerks as they usually are knowledgeable and if you used their scan tool then you are there already. Sometimes they can provide a detailed printout of what the error code means which is even more helpful. Also you will probably need to purchase a new part anyway which is why the auto parts store lets people use the scan tool for free.
In my experience most codes are caused by old spark plugs (misfire), old O2 sensors (slow sensor, bad reading for a sensor, failed sensor), old spark plug wires or boots (misfire), or some failed sensor (throws a sensor failed code). The good news is that a lot of these issues can be avoided by following a maintenance schedule and replacing these parts before they cause a problem.
Finally in closing let me say that it is always a good idea to solve vehicle issues right away. The check engine light looks the same if you have one error code or 50, and with it on your vehicle is not running as well as it should and may be wasting fuel, polluting, or wrecking other parts without your knowledge.