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.
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.