"Safe Mode" eliminates possible effects of user-installed system modifications that might have explained the occasional unresponsiveness you are experiencing. If the same problems manifest while running in that mode, it raises the likelihood of hardware-related failure.
Sometimes, merely starting a Mac in "Safe Mode" followed by restarting normally will remedy whatever had been affecting it (due to certain actions Safe Mode performs), but you tried that and it didn't help.
You can try reinstalling macOS: Reinstall macOS - Apple Support, but it seems likely that you will need to contact Apple and arrange for a hands-on inspection.
Start here: Get Support