If your iPhone is showing a black screen when you open the Camera, the issue is most likely software related and hopefully nothing to do with the Camera or the Lens.
You should be able to fix iPhone Camera Black Screen issue by using the following troubleshooting steps.
1. Check iPhone Case & Camera Lens
If you are using a Case to protect your iPhone, make sure that Case is not blocking the front Camera on your device.
Also, take a good look at the Camera Lens and clean the lens, if you find it covered by dust or grime.
2. Close the Camera App
As you must have noticed, there is actually no way to close the Camera App on iPhone.
However, unlike other Apps, the Camera App does not run in background and closes when you dismiss the Camera App by swiping-up from bottom of the screen or by pressing the power button.
If your iPhone has a Home Button, you can close the Camera App by pressing the Home Button and also by using the Power button.
3. Switch from Front to Rear Camera
Sometimes, the Camera App can become glitchy and users have reported fixing the problem by Switching from Front to Rear Camera for a short period of time.
Tap on the Switcher Icon to switch from Front to Rear Camera > Wait for 10 seconds and tap on the Switcher Icon again to return back to the Front Camera.
4. Turn ON/OFF Flashlight
The front LED light on iPhone is used by both Camera/Flashlight and sometimes the problem is due to the Flashlight not working or not being synchronized with the Camera App.
Open Control Center and tap on the Flashlight icon to switch ON the Flashlight.
After a while, open the Control Center again and tap on the Flashlight icon to close the Flashlight.
5. Restart iPhone
Stuck Apps and processes can interfere with proper functioning of the Camera App.
Go to Settings > General > scroll down and tap on Shut Down.
This will bring up the Slide-to-Power OFF screen, use the Slider to Power OFF iPhone.
Allow iPhone to completely Shut Down > Wait for 30 seconds > Restart iPhone and see if the Camera is now working.
6. Switch OFF Voice-Over Feature
Make sure that the VoiceOver feature on your iPhone has not been accidentally switched ON.
Go to Settings > Accessibility > VoiceOver and move the toggle next to VoiceOver to OFF position.
Now, try to access the Camera on your iPhone and you should find it working properly.
7. Install Updates
Make sure that your device is up to date with the latest Software Updates.
Go to Settings > General > tap on Software Update.
On the next screen, tap on Download and Install (in case an Update is available) and follow the instructions to install the updates.
8. Reset All Settings
If above methods did not help, you can try to Reset All Settings on your device to Factory Default Settings and see if this helps in fixing the problem.
Go to Settings > General > Reset > select Reset All Settings option.
This step will not erase any data from your computer, but it will erase your WiFi Network Password and disconnect your iPhone from the internet.
After iPhone restarts, you will be required to join WiFi Network by entering your WiFi Network Password.