how to replace the 02 sensor
Its likely the HEGO (heated exhaust gas sensor) but possibly a connector or the harness its self they can be damaged from heat and or abrasion Inspect it first before just changing a sensor UNLESS it was read with the Toyota Techstream scan tool, that's a sure diagnosis of the sensor.
Search Toyota Highlander Questions
Are you a UK consumer? CarGurus now has a discussion forum in the UK.
Toyota Highlander Experts