My check engine light came on about a day ago,

so I took my car to Auto Zone and they said that the O2 sensor needed to be replaced. They asked me if the sensor was before or after the cat and I said before, I think.

So today when I was looking in the Haynes Manual it looks like it is before the cat. Is this correct? Also how hard is it to replace the O2 sensor. Anybody have a how-to on how to do such a thing, I looked in the Haynes Manual and there wasn't anyting. If there is something in Haynes what page would it be on? Thanks in advance.