Hi! Welcome to the samsung members community!
How strange-
*firstly, go to settings- apps- camera- storage- clear cache. Restart device.
*clear cache partition
Turn off the device.
• Connect the phone to a computer. Press and hold the Volume Up key and the Power key.
• When the Android logo appears, release all keys.
• Use the Volume Down button to highlight Wipe cache partition.
• Press the Power button to select Wipe cache partition. • Use Volume Down to highlight Yes.
• Press the Power button to confirm the action.
*does the camera work on other apps such as snapchat/ whatsapp/ messenger?
Go to samsung members app- support- diagnostics- pass okie?
If non work- may need to backup all your data to a pc via smartswitch and then factory reset device