Go step by step and test.
1. Update the software on your Mac,
Update may come with bug fixes.
https://support.apple.com/en-us/HT201541
1. Reset PRAM: Reset NVRAM or PRAM on your Mac - Apple Support
Settings that can be stored in NVRAM include sound volume, display resolution, startup-disk selection, time zone,
and recent kernel panic information.
The settings stored in NVRAM depend on your Mac and the devices that you're using with your Mac.
2. Reset SMC: How to reset the SMC of your Mac - Apple Support Choose the appropriate method.
Quote:
Resetting the system management controller (SMC) can resolve certain issues related to power, battery, fans,
and other features.
3. Startup in Safe mode. https://support.apple.com/en-gb/HT201262 Choose the appropriate method.
To leave Safe Mode, choose “Restart” at the bottom.
Quote:
Safe mode prevents your Mac from loading certain software when it starts up, including login items,
system extensions not required by macOS,
and fonts not installed by macOS. It also does a basic check of your startup disk,
similar to using First Aid in Disk Utility.
And it deletes some system caches, including font caches and the kernel cache,
which will be created again automatically as needed.
4. Contact Apple.
If steps posted above do not help,
Click inside the box to choose an option. contact Apple Support.
https://getsupport.apple.com/?caller=kbase&PGF=PGF63005&category_id=SC0245&symptom_id=23362