Trick One: Use the iTunes eject
This may sound silly, but if your stuck disk is a DVD, try opening iTunes and hitting the eject button. Your problem may lie in the DVD player's software. If it is frozen, the disk will not eject. Trying the iTunes eject button ensures that it is not simply a problem with that application preventing you from ejecting a stuck disk.
Trick Two: Restart while holding the mouse button down
It sounds strange but it works. Turn off your iMac. Then push down on the button of your Mighty Mouse. Restart the machine. This should eject the disk. In fact, this is one of the first things that they will try when you bring your machine to the genius bar. It triggers the auto eject during start up. Unless the disk is physically jammed, it should come out. Do not be afraid to try this one a few times because you have to get the timing right. The safest bet is to simply hold it down before you begin the reboot.
Trick Three: The Disk Utility
Finally, lets move onto your disk utility. You can find it under applications -> utilities. Once it opens, you should see a list of your drives. Find the one labeled with the name of your stuck disk. Click on that name, then look up. You will see a button labeled eject. Go ahead and click on it. Your disk should be popping out any time now.