Hello and welcome.
The best solution would be to take it to an Apple Store. They can remove it pretty easily.
There are a few home remedies for this around the Internet, including turning off the iMac and shaking it, using a bent paper clip (not recommended), using a cutout piece of a manila envelope, and using a few pieces of packing tape pressed together for stiffness. Of course, all of them should only be attempted at your own risk, as you can easily damage the internal components of the optical drive, which could require replacement.
C