you should make sure your device has a decent charge in its battery before you attempt these steps. If the battery level is too low, the camera often won't work
Reports of 'camera failed' errors on the Galaxy S6 and S6 Edge are rare, but some users do experience them. In most cases the problem appears to be a third-party app that’s messed things up, so booting into safe mode is the way to test that: turn off your phone, press and hold the Power key and, when the Samsung logo appears, release it and hold the Volume Down button instead. Your phone should now restart in safe mode.
If the camera works in this mode, you don’t have a hardware or firmware problem. Unfortunately if it doesn’t work in safe mode, then you might. Want to fallow the next steps down below.
In many cases, the 'camera failed' error occurs because the Camera app has got itself into a bit of a mess. You can often solve that with a fairly simple bit of housekeeping. Go into Settings > Applications Manager and then swipe left for All Apps. Scroll down to the Camera app and tap on it. Now tap on Force Stop, then Clear Cache, then Clear Data. Don’t worry: this won’t delete any of your photographs, but it will delete your camera’s settings so you’ll need to set those again. Reboot your phone and see if that worked.
If it didn’t, step two is to clear the cache partition. To do that, turn off your phone and then press and hold Volume Up, Power and Home. Once the phone vibrates, let go of Power but keep the other two buttons pressed. Once you see the Android Recovery screen, navigate to Wipe Cache Partition using the volume down key and use Power to select it. This won’t delete your data but it should reset the app’s cache, which should solve the problem.
Nothing? Time for the nuclear option: a factory reset. Make sure you take backups of anything you need first, as this will return your phone to factory-fresh condition without any of your stuff on it.
Still no joy? Dump the app altogether and try the excellent Google Camera (KitKat or later required) or one of the many wonderful third-party camera apps out there. Read the reviews carefully though: some camera apps are better than others. There's no point in installing a duffer.