I'd use this set, the smaller socket: https://smile.amazon.com/dp/B07W91Y3LQ
I had the same trouble a few years ago. Tried everything: blowtorch, penetrating oil, a hammer, everything. Only thing that eventually worked was a bolt extractor (just an example, only need to make sure you get one the right size from wherever) and abreaker bar for extra leverage over my ratchet. Popped off easy with that.
Make sure you have a new sensor ready to go, get a bolt extractor, cut the wires, bust the shit out of that sensor, then make sure the threads of the new sensor are clean and have a little anti-seize grease (copper is fine) on them for easier removal if necessary later on.
Be warned this WILL destroy the old sensor, but that's probably obvious and usually O2 sensors aren't being removed to be put back.