Depending on the type of car, it may have one or two oxygen sensors. On cars that have only one sensor, it is usually located near the exhaust manifold, but in cars with two oxygen sensors, the second sensor usually is found down from the catalytic converter.
If deciding to change the oxygen sensors at home, it is important to replace and remove the sensors one at a time, and take care to install each oxygen sensor in the right location. It can help to look at the sensors before taking them off, so the new one is recognized during installation.
When the wire is removed from the oxygen sensor, loosen the bolt that holds the sensor to the exhaust system with a crescent wrench, and then remove it. Put the new sensor in its place, connect it to the exhaust system and ensure the clip of the wire clicks into its place. Be sure that the wire is routed the same way it was before it was removed. It is important to keep it away from the exhaust pipe because of heat.
Keep in mind that the car needs to be raised in order to access the oxygen sensor, so make sure it is secure and supported before getting underneath it. Also, since this work is done near the exhaust system, it is important to ensure it is cool before working.