Place the front of the car on jacks or use a ramp, then spray
the old sensor with a lot of WD40 (with cold exhaust). Let
it sit for awhile then you can remove the sensor with the
sensor socket some extensions and u-joints. Don't forget to
apply a coat of anti-seize compound on the new sensor threads.
NOT on the tip!!!
In any model, you don't have to remove any part of the exhaust
line.
525i
M20 : The O2 sensor is located below the #6 cylinder
on the front of the exhaust pipe. The connector is located
on the right-hand rear of the engine, near the electronics
box.
M50 : The O2 sensor is located at the front of the
catalytic converter. The connector is located on the left-hand
side of the engine, below the starter.
530i - 540i
The M60 engine uses two O2 sensors located at the front of
the catalytic converters.
The connector is located beneath the car under the transmission.
535i
The 535i uses a single O2 sensor located at the front of
the catalytic converter under the car. The connector is located
at the rear of the engine compartment, lower left-hand side.