Why my iphone 7 back camera not working

for the last two month i cant access my iphone7 back camera and flash light.
what will be the main reason,is it is related to some software issue , if i go to service how much will be the cost,
The only way to know for sure if it’s a software issue would be to put your phone into recovery mode and restore it through iTunes. This will force iTunes to overwrite your previous iOS installation. Set it up as a new device (rather than restoring from a backup) and check to see if your camera and flash work again. If they don’t it’s likely a hardware issue. I have no clue how much that would cost but I’d sure that depends on what needs to be replaced, your geographic region, and where you take it for service.
Take it to the Genius Bar and have them run diagnostics. Make sure to back it up before going.

Original thread: https://forums.imore.com/threads/why-my-iphone-7-back-camera-not-working.411307/