Hello, the sensor is located at the top of the engine near the valve cover at the exhaust manifold area.
However, troubleshoot this to ensure the sensor itself has failed. Other things can cause the code to set.
RepairPal Certified shops can diagnose and repair your 2004 Toyota Corolla. They provide transparent pricing with a minimum 12-month or 12,000-mile warranty on repairs and services.