locate the o2 sensor on the rear exhaust manifold.
if you are trying to save the old sensor, rent this kit from your local parts store
if you don't care about the sensor, just cut the wire off and use a deepwell socket to remove it.
it will be easiest to remove if you have the exhaust pipe warmed up, but not so hot you can't touch it.
if it doesn't want to break loose, spray some penetrating oil on it.
installing the new sensor is just backwards.
apply some anti-seize on the threads before installing it (should be included) and tighten with the special socket or open-end wrench.