Summary

After updating to windows 11 camera is not functioning but it was working fine before the upgrade in windows 10.

Resolution

Fix #1:
Step 1:
Go to the search box next to the Windows icon and type CMD

Step 2:
Right-click on Command Prompt and select Run As Administrator

Step 3:
Type msdt.exe -id DeviceDiagnostic and press enter.

Step 4:
Click Next on the Hardware troubleshooter wizard.

Step 5:
Restart PC (Mandatory)

Alternative Solution:

https://support.microsoft.com/en-us/windows/camera-doesn-t-work-in-windows-32adb016-b29c-a928-0073-53d31da0dad5#WindowsVersion=Windows_11