At least this is how I did it after a P0133 code.
The back ground on my truck (1999 F150) is that I am the second owner (my former neighbor was the first) and it has 293K miles on it at the time of this post. The truck is bone stock FWIW.
I searched the internet and couldn't find a good step by step replacement write up. The front oxygen sensor on the passenger side is hard to get to so here is what I did:
Jacked the truck up and placed jack stands under it. Removed the front passenger tire and the plastic wheel well liner.
Tools needed for this part are a 7/32 socket and a trim tool remover (for the plastic push in fittings).
There are 5 screws and 3 or 4 plastic push retainers (don't know actual term) to remove.
Because of the location of the sensor I had to remove the transmission dipstick tube. *If you do this have a pan or bucket under this area as you are going to lose fluid*
the dipstick tube is held place by an 8mm bolt about the middle of the exhaust manifold. Unscrew it and with a little pressure the tube will pop up and out, and so will some fluid.
Wheel well liner out and dipstick tube pulled out of the way.
The connector where you will disconnect the old 02 sensor is tucked up behind the engine block and is kind of hard to get to. A little time and patience and you can get it separated.
From underneath the truck I cut the end off of the old 02 sensor (because the closed end of the wrench wouldn't fit over it) and used a 7/8 box wrench to unloosen the sensor a little at a time until I could get it out with my fingers.
I put the new 02 sensor in finger tight and then tightened it down with small turns of the 7/8 wrench until tight
The cord on the new sensor is longer than the factory one so once reconnected I used zip ties to keep the slack up and away from the hot parts.
New 02 sensor installed and dip stick tube back in place. Note the attachment approx 1/2 down the dipstick tube. It is the 8mm bolt I previously mentioned.
Wheel well back in place.
Truck lowered back to the ground.
Hope this helps someone else out, as many on here have helped me.
Have a good one.