An O2 sensor can fail in a variety of ways, some affecting the petrol engine more than others. Typically it will slightly affect the efficiency of the engine. Replacement is normally easy, you just need to have the correct split socket, especially designed for an O2 sensor, and use the anti-seize compound that comes with the new sensor on the thread so it can be removed in the future.