Go step by step and test.
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.
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.
You can try Apple diagnostics.
https://support.apple.com/guide/mac-help/diagnose-problems-mh35727/mac
Contact Apple support.
Click inside the box to choose an option.
https://getsupport.apple.com/?caller=kbase&PGF=PGF63005&category_id=SC0245&symptom_id=23362