These photos are of the drivers side (USA) post-cat O2 sensor, but all four sensors attach the same way. The only exception is the pre-cat O2's wire is not held to the body by the metal clips.
Get your car on ramps/jackstands/a lift:
Get some light:
Prepare a breaker bar. This is a 22mm crows foot extension. Special O2 sockets also exist.
Here's a shot of the post-cat O2 (to the right of the CAT). Notice the wire attached to the body by two metal clips. The front of the car is to the left. Hopefully your breaker bar gets it loose.
Here's the wiring box. The front of the car is to the right and the post-cat wire is coming in from the upper left. Notice the metal clip. The two 10mm nuts need to come off.
Here's the open box. The front of the car is in the background. The post-cat O2 sensor plug is pressure fit to the 4-prong connector you see at the top of the photo. The connector is keyed. The O2 sensor and this plug will only go together one way. Once connected the assembly snaps into the box cover. The pre-cat connector is pictured fully assembled on the left for reference. Be sure you pinch no sensor wires putting this box back on the car.
Here's my old O2.
Assemble your torque wrench. The torque setting is 50Nm. I noticed that the sensors actually have a crush washer similar to spark plugs so it'll take a bit of turning before it snugs up tight. 50Nm would be for an O2 socket. Any attachment (like my crows foot) that effectively changes the length of the wrench requires a little math. This simple formula is at the end of this DIY and may even be included in your torque wrenches manual. My number dropped from 50Nm to 45Nm to make up for the increased lever length. It probably doesn't matter too much since this is a steel on steel connection with pretty big threads.
That's all there is to it really. Good luck!
T(W) = T(E)* L/L+E
L - Lever length of the wrench - center of the hand grip to center of the drive head (where sockets attach). (14.5in)
E - Effective length of extension. (1.5in)
T(E) - Torque applied by the extension to the fastener.
T(W) - Torque set on the wrench.
I'll use my (lengths) as an example.
45 = 50*(14.5/14.5+1.5)
Inside the ()'s I wound up with ~.90...multiplied that by the extension torque I wanted applied (50Nm) and you see that my wrench needed to be set to ~45Nm to compensate to the extra lever length the crows foot provided. The formula assumes the extension and wrench are assembled in a straight line. Your numbers will vary of course. Not needed for standard sockets and/or extensions...only attachments that LENGTHEN the lever arm.
So you use that crow foot thing to get a reduction in work done of 10% (50NM output from 45NM input)?
London I used it because I already own it. Special O2 sockets do exist though with a slot down one side to let the wire out. I will add that the whole system is recessed under the car and a socket may have been harder to use. That dimpled heat shield is pretty close to the end of the sensors where the wire comes out. An O2 socket + torque wrench might be a tight fit, but I'm nt 100% on that. The crows foot eliminates that possibility.
Here's a pic of my set for those unfamiliar with this tool. They are sold individually as well, but for $10 USD I just grabbed the set.
Looking back on the write up, there is no mention of anti-seize compound. I have always put anti-seize on any screw in exhaust components. Taking great care not to get any on the sensing surface. Is there something special about these sensors or something I missed?