O2 Sensor? Probably NOT the problem.
People like to blame the O2 sensor for the problem because that's where the computer fault appears.
However, nine times out of ten, it's not faulty. It is simply reading a condition in the engine that is causing it to send a signal to the computer that there is a fault in the exhaust emissions mixture.
A fouled spark plug, loose spark plug wire, a vacuum leak, dirty injectors, EGR valve, weak fuel pump, dirty fuel filter, weak ignition coil, plugged air filter, on and on, can all cause the O2 sensor to register a fault code.
Before you yank the O2 sensor and replace it, check the basics first. Otherwise, you could have wasted time and money on the result, not the cause.
ADDED:
(Check Engine Light)
There are many components that work together in the engine to maintain optimal engine performance and economy.
A "check engine" light indicates that there is a sensor that is reading a condition that is "out of range".
Simply resetting the light does not solve the initial cause of the problem.
Replacing a number of parts trying to troubleshoot the problem in the hopes of getting the light to stay off is a tremendous waste of time and money.
The simplest, and most economical way to alleviate your issue, is to have an engine diagnostic done by a reputable shop to determine what caused the computer to signal you to begin with. Just reading the computer codes may not find the "cause".
That being said, if per-chance you feel the need to reset the light in the hopes that it was a "glitch" of some kind, you could disconnect the negative battery terminal for a couple of minutes to clear the check engine light. (ignition key turned on)