how can one tell which is bad
Tell us the codes from the computer. We are told Autozone will read your codes for free. Without them, your question cannot be answered.
Hopefully your car is 1996 or newer. The ODB-II system will set a trouble code that will point directly to the sensor that is the problem.
As others noted, the car computer will set a code if the signals it gets from the oxygen sensor are too low or unexpected. Unfortunately, the code that your computer stores can only tell you what the computer is ‘seeing’. It often takes a bit of detective work to determine the true problem. The computer code is just one of the clues.
You can tell if the sensor is really bad with a digital voltmeter. There are instructions for doing this in many places on the web.
If it not completely failed, but is old and slow-to-respond, it will not work properly with an OBD2 computer system (any car less than 12 years old). You need an oscilloscope to determine if it is getting slow to respond. Most shops will just put in a new one before going to the trouble to connect it to a scope.
Telling us the year, make, model and mileage of the vehicle as well as why you’re asking might be a huge help. If you’re talking about an OBD-I vehicle with a V engine and two upstream sensors and no downstream sensors and you’re having an operating problem the question is entirely different than if you’re talking about an OBD-II 4-banger with one upstream and one downstream sensor and you’re not having an operating problem but simply a CEL light.
Jeeze, man, give us something to work with here!