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 the thermal sensor is stuck to the optical drive, skip to the next step.
Use the flat end of a spudger to pry the optical drive thermal sensor bracket up off the adhesive securing it to the optical drive.
If the adhesive gets dirty or will not stick to your new optical drive, place some double-sided tape under the two semicircular ears of the thermal sensor bracket.