Des the Camera workin Photo Booth?
Start with this of M1 Mac...
Start up a Mac with Apple silicon in safe mode
On your Mac, choose Apple menu > Shut Down.
After your Mac shuts down, wait 10 seconds.
Press and hold the power button on your Mac until the startup options window appears showing available startup disks and Options.
Select a startup disk.
Press and hold the Shift key, click Continue in Safe Mode, then release the Shift key.
To leave safe mode, restart your Mac normally, without pressing and holding any keys during startup.
Start with this if IntelMac...
Safe Boot, (holding Shift key down at startup), does the problem occur in Safe Mode? Could take 10 minutes or more.
Safe mode attempts to repair Disks & clears lots of caches & loads safe Drivers, & prevents loading of 3rd party extensions, so if Safe Mode works try again in regular boot.
To find out if it's system wide or user specific, try this...
Open System Preferences>Users & Groups, unlock the lock, click on the little plus icon, make a new admin account, log out & into the new account.
Does it work in the new account?