Most times o2 sensor codes are not the sensor themselves but other controls. A code never identifies a bad part just a failed system.
There is a lot to properly diag a code. A scan tool is the best tool so you can view the info in making your decision for the failed part. Looking at long and short trims, check the heaters and wiring is critical.
If you have no experience, at least let a shop identify the failure for you.