Check engine light on. O2 sensor problem. Loud rattling noise. on 2003 Chevrolet S10

My check engine light came on and I took it to an auto parts store. They said it was an o2 sensor. The truck makes a loud rattle underneath.Its louder with the a/c on. Could this be my catalytic converter?

Asked by for the 2003 Chevrolet S10
Yep,time to replace the cat,with and the downstream O2.