An oxygen sensor code doesn’t always mean a bad O2 sensor. If the computer sets a soft code, this means the SES light doesn’t stay lit and chances are there is something affecting the mixture and the computer is throwing an O2 code. Check the ignition components and the fuel injectors. Both issues could change the exhaust mixture and cause the oxygen sensor to send a code. If you get a preheater code, that is a hard code and you do have a problem with the oxygen sensor. The code reader will tell you which oxygen sensor is bad if your vehicle has more than one.