Why Does My iPhone 5s Back Camera Won't Work? Here's The Fix.
What device are you using and what iOS? I’m seeing some issues on older devices. Have you done a Hard reset in the device or just a restart? Have you tried to do a restore?
People with the same issue have to go through troubleshooting including restarting, a hard reset, then restore. It may also be a possible bad backup as well. If nothing works, then it’s usually a hardware issue with the camera that needs to be replaced.
I am seeing this is an issue that happens with the 5s more than anything. Even if your device may not be under warranty, you can still bring it to Apple for checkup.
Apple will charge unless they have a known issue with the camera that they acknowledge. You can also try a third party repair shop.