I was changing the valve cover gaskets on my 2001 Toyota Tacoma v6 and I was trying to remove the valve cover on the drivers side.
I didn’t realize I needed to disconnect this sensor and when I pushed the cover up it pulled the wire out of the connector.
This is just behind the cylinder block...