Long press camera app and tap on App Info then go to Storage and the tap on Clear Cache and see if it works. Also try to Clearing Cache of device to do so see the link
Have you tried going to safe mode and see if the issue also occurs there or not. If not maybe some app is interfering with the camera app.
If you've found my post to be helpful, please like the post. If my response resolved your issue, please press the "✓ Accept as Solution" button.
Have you also tried wiping the cache partition of your device, not just the camera application?
I wanted to include the steps to complete a cache wipe of your device.
1. Turn off the device.
2. Press and hold the Volume Up key and the Bixby key, then press and hold the Power key.
3. When the Android logo displays, release all three keys.
4. An ‘Installing system update’ message will show for 30 – 60 seconds before the Android system recovery menu options appear.
5. Press the Volume down key several times to highlight wipe cache partition.
6. Press Power key to select.
7. Press the Volume down key to highlight yes, them and press the Power key to select.
8. When the wipe cache partition is complete, Reboot system now is highlighted.
9. Press the Power key to restart the device.