There should be 4 wires to the O2 sensor a red with white tracer. A pink with a black tracer. A grey with a green tracer. A black with a blue tracer. Looks there has been at least damage to the outer jacket to that wire assembly. Possibly it was in close proximity to the exhaust up pipe.
Check that those wires are still insulated and repair it so there is a suitable jacket protecting those wires.
If the wires are undamage you might wrap them in some glass tape and then slit apiece of pex to slide over the damaged area.