For clarification, are you having issues with your S Pen stuck inside of the device and won't eject?
Can you give a bit more detail on what's happening with your camera? Is this happening with your stock camera app? Is your device automatically capturing pictures when not in use?
Have you attempted to force stop and clear cache/data on the app?
Navigate to your settings > apps > click on the 3 dots in the top right corner > select "Show System Apps" > find and click on Camera > force stop > storage > clear cache/data.