You have to get the code scanned before preceding. Trying to figure out what is wrong from just the check engine light is like the doctor figuring out everything from just the word "I'm not feeling well."
Right now it could be something simples as loose gas cap, or something expensive like your catalytic converter failure. You just don't know.
Go to Autozone (or one of the many auto parts dealers) and have them scan the code. They will read out the code and possible repairs. You can come back here and ask more question. Just remember that just because the code mentions a car part (like O2 sensor) it doesn't mean that part failed but that part had bad reading.
ex: your O2 sensor can be reading something really bad but that could be something else like the fuel injectors or the MAF sensors.
===
But the first process is the scan the code. Also if you plan to have the car for some time it is wise to invest in one. Besides reading / scanning the code, they can also clear the code. And you can get them at Autozone or sears as cheap as $50 on sale (or even cheaper on line).
Good Luck
===
Don't forget to vote for the BEST ANSWER - please - whoever it may be.
FACT: You also get +3 points when you vote for BEST ANSWER