Pull the levers on the optical drive out and it will release it.

Now you can pull the drive out and disconnect it. Be carefull not to bend the pins on the IDE plug. The IDE cable may have an adhesive strip holding it to the drive.