Insert a spudger between the optical drive connector and the optical drive.
Twist the spudger to slightly separate the optical drive connector from the optical drive, then use your fingers to pull the connector away from the drive.
To remove the optical drive thermal sensor, use the tip of a spudger to lift the center finger of the thermal sensor bracket while applying slight tension to the thermal sensor cable.
If your thermal sensor is stuck to the optical drive, use the flat end of a spudger to pry the thermal sensor bracket off the drive.
If the adhesive on the bracket refuses to stick, apply some double stick tape to the underside of both flat bracket ears.