CD players sometimes eject discs without playing them because the CD is not the proper format for the machine, there is dust in the machine, the CD player's laser is defective or the disc has not been inserted correctly. If a disc is inserted upside down or while another disc is already in the machine, the player will reject it.
Trying a different disc will help the user determine whether the problem is with the disc or the CD player. If other discs play normally, the original CD might not be in the correct format for the stereo. For example, CD-RW discs (CD-Rewritable) cannot be played as audio files in regular CD players, but CD-R discs (CD-Recordable) can.
Some CD players come equipped with a "reset" button. Pressing it might restore the player's functionality and allow the user to play the CD. Otherwise, the player might require a service by the manufacturer or a qualified technician.