Reset the Camera app
Settings → Apps → Installed apps
Find Camera
Advanced options → Repair
If that doesn't help → Reset
Check the camera driver
Right-click Start → Device Manager
Expand Cameras
Right-click Surface Camera / Front Camera / Rear Camera
Choose Uninstall device
Restart the Surface.
Windows should reinstall the camera driver.
Run Windows Update, including Optional updates → Driver updates.
For a Surface, also make sure the appropriate Surface driver and firmware package is installed for the exact model.