Whatever the reason, the first thing I advise you to do if your unit is stuck is to try force a reboot. To do this, just hold down the button with the Xbox logo located at the front of the console until it turns off. When this happens, press the same button again to start the console and, if all goes well, you should have no problem to eject the drive.
How to eject an Xbox One disk manually
If the reboot was not enough and the console remains stuck with the drive inside, you must use the manual method to eject the player's game.
To use this option you will need a big clip or a similar object. It needs to be long enough (at least 5 to 6 cm) and strong, because you will need to insert it into a console hole and press a button on the inside to remove the disc.
Once you have the clip, unroll it to make it longer and disconnect the console from all cables, especially food.
Now look for the manual eject hole in the console. In the case of the Xbox One, you will find it on the left side just between the USB port and the side of the slot to insert the discs as you can see in the picture above. If you have an Xbox One S, it will cost you a bit more to find it because of its grid-filled design of holes. Test the second from the right and the second from the bottom; as in the other model to the left of the slot in which the discs are inserted.
When you insert the clip, you will notice some pressure and, by pressing, you will see how the disc starts to come out through the slot. When you begin to see it, hold it and gently remove it from the console.