The S Pen gets stuck in its holding area because its cap is hindered by a small piece of the detection sensor that's hanging out over the holding area. Unfortunately, those who forced to yank the S Pen out have ended up damaging not only the S Pen but also the vital component used to enable certain phone features -- the detection sensor.
Without the detection sensor, phase detection auto-focus for the phone's camera as well as input recognition would somehow be devoid.
That being said, preventive measures must be set. Therefore, never put the S Pen into its slot with end first. You could file off the protruding edges or attach something like a small rubber band, or a piece of tape to the end, thus preventing S Pen from fitting in backwards easily.
But what if the S Pen is already stuck?
If preventive measures are no longer applicable like for example, you just happened to insert the S Pen backwards unintentionally, never use force to pull it back out. Instead, follow the recommended procedure below.
Fortunately, some people are always eager to find ways to fix any emerging problems especially on hefty devices like the Galaxy Note 5. While this method is deemed the ultimate solution to your stuck S Pen in your Note 5, performing it requires more guts and prudence. Why? Because you've got to dismantle your device. In line with this, anyone who is willing may try this method except for those with the Galaxy Note 5 under warranty.
- Cut a piece of paper of an extremely thin card with the same length as the S Pen (approximately 4 inches).
- Fold the paper symmetrically (lengthwise) and slide it in the side where the stylus (S Pen) is stuck. It should go towards the body of the phone, so on the left of the S Pen, from the bottom view with the screen up.The paper should trigger the clamping mechanism to open, allowing you to slide the S Pen without causing any damage to the sensor.
- Slowly and carefully pull the S Pen along with the paper downwards until it's completely out.
For a more detailed demonstration, here's a YouTube video on how to fix a stuck S Pen on the Galaxy Note 5, courtesy of How2Tech.
If you hesitate to do the aforementioned procedures by yourself, then you can just contact Samsung or your phone carrier and have it fixed or replaced. If you're fortunate enough, you can return your device for repair under warranty.