A new oxygen sensor for a car can cost from $20.00 to $100.00 so if you do it yourself you can save a lot of money.
But if you take the car to a shop there might be a markup on the price of the new oxygen sensor which could be $150.00 or more for the oxygen sensor and then the cost involved for the labor which would be the shops hourly cost.
Different auto shops charge different hourly rates so you might be paying $300.00 to $500.00 to replace your vehicles oxygen sensor.
Some of those oxygen sensors can be really stubborn in removing. I've replaced a few myself but had to take one of my cars to a shop to get one replaced because I couldn't get the darn oxygen sensor out and the shop charged me $300.00 to do the job.
But the car needed the oxygen sensor so it would run correctly so It was worth it to pay the $300.00 to have my car back.