This is a common problem with optical drives. Laptops usually have a spring loaded eject which requires you to pull the tray out and remove the disc that is snapped into the spindle, or a mechanical feed in which there is no tray and it grabs the disc to take it away.
Desktop computers usually have the mechanical tray that ejects all the way out with a disc that rests in the pocket of the tray.
Unfortunately usually when these drives act this way to not eject a disc they are damaged internally, which can be anything from a broken piece of plastic to a gear tooth or catch, to a rubber belt that is slipping, stretched, or popped off.
The good thing is that optical drive replacements are usually not too expensive and some laptops come with removable optical drives which do not require you to have to open the laptop.
To help further... what is the make and model of the laptop so I can see what you are up against and direct you on the best corrective action for this computer.