EBD codes for 2004 Accord

Sorry for more questions on OBD codes but I’m trying to understand my problem. The check engine light came on for a week and then off and then on etc… I thought it was the gas cap or wet/loose wire on the 1st O2 sensor. Well, I went to advanced auto and they said P0141 I think (bank 1, sensor 2 after the cat convertor) and the right rear ABX wire/reader. He told me to clean the ABS sensor (it was filthy with dirt and I can see how it can’t read) and I did the other rear and the front left one (it was different on the front than the back and was clean so I didn’t do the right front). So, now the light is still on probably due to the O2 sensor. I intend to get a mechanic change out the sensor (denso at adv auto for 70 bucks plus labor) and reset the computer to see if the ABS sensor code comes again or it’s fixed.

Why did the check engine light come on and off? I thought once on, it only goes off if it’s a gas cap issue.
Next, does the computer reset itself or will a mechanic have to reset it?
Can the ABS switch be just dirty or do they die and it needs replacement?
Why didn’t the ABS light on the dash come on if the error code was for the ABS wire which will mess up the ABS system?

Thanks for any help again.

I see online the scanner can reset the codes after it’s fixed or taking the battery lead off and turning on the lights for 10 minutes.

oh, and I forgot to say. the Advanced auto guy said clean the ABS sensor and put back together. That might/should fix it. For the O2 sensor, he sold me Seafoam to put in the gas tank trying to clean the system and O2 sensor from junk. Not sure if that will work. Usually these O2 sensors have heaters and need replacement but I was hoping for a cheap fix.

Replace it with an OEM O2 sensor. Aftermarket can still throw a code. I found my OEM O2 sensor on Amazon for half the price of a Denso from Autozone/Advance.