Typically, a replacement drive needs a few things to work:
- Correct connector: Make sure you get a SATA or IDE/ATA drive as needed. Your Mac is new enough that it takes a SATA optical drive.
- Correct height: Some optical drives are 9.5mm thick, and some are 12.7mm thick. This is important.
- Slot-loading: Obviously.
There are also a few setup things you'll probably need to do:
- Remove the bezel. It just won't fit with it on.
- Unplug/desolder/snap off the pushbutton on the front, as it's unpopulated on the OEM drives Apple sources.
You'll probably also want to do some searching before buying, just to see if there are any odd-ball compatibility issues -- xlr8yourmac is a great source for info.