Agree w lfhoward. 4 o2 sensors on a 2002, correct? (I have a 2003 and I know I have 4, never hurts to confirm) Upstream/downstream, driver side passenger. Cyl #2 and #6 are misfiring so the whole passenger side exhaust is getting gunked up.
Before you replace the sensor, 2 questions:
1. Are you getting any exhaust smoke at all, even a wisp?
2. When was the last time you replaced your plugs?
If you are getting smoke and you have >200K on the odo, you may be getting ready to blow a ring and need to have a shop really check it out. No smoke, read on and DIY.
Logically speaking dirty misfires mess up cat sensors, egg before chicken.
Misfires will cumulatively mess up O2 sensors, and if the root cause is incomplete combustion due to bad plugs... a replaced O2 it will just get filthy again... and you'll have to buy another O2 sensor again. NGK v-power copper plugs, gap at 0.40 (regardless of what the auto shop catalog or mfr posts). Check the problem plugs #2 and #6 1st and if their gap is way off and/or appearance is bad, then *replace all 6 plugs good or bad with a matching .040 gap* and do a hard reset on the PCM by disconnecting neg battery cable 1st, then pos cable, hook the 2 loose battery cable connectors together and let them sit for about 10 minutes before reconnecting in reverse order to the battery. That'll wipe all codes by completely draining the static memory of the PCM.
If misfire codes stay gone, drive it for a while and maybe the O2 sensor deposits will cook off, the O2 code disappears, and you save the replacement cost. Probably not, and the best you can hope for is the cost of just 2 new sensors... but the cat is probably trashed too.
If only the O2 code persists, then the up and down sensors are probably permanently damaged. Replace them with with NGK parts, make sure you identify the correct part numbers. All 4, up/down and pass/driver, are all unique part numbers. Double check them on the NGK web site.