If the Mac is frozen or refusing to reboot, you can do a forced reboot as well. Once all of those apps have been quit, go ahead and restart the Mac as usual by going to the Apple menu and choosing “Restart”. If the apps are stuck or not responding, go ahead and use Force Quit on the apps to exit them. Be sure to quit the System Preference app as well. Next up is to quit out of every app that is using iCloud, this includes quitting Messages, quitting FaceTime, Calendar, Notes, Reminders, etc. Quick side note: if iCloud was down but is now back up, there may be a lingering connectivity issue due to caching or otherwise, in that case proceed with the steps below and you can likely resolve the connection difficulty. If iCloud is down, you will need to wait until it is back up again before being able to resolve the issue.
The first thing you should do is check if iCloud is down or not by going to and confirming that all Apple online services are available.
This is a multi-part series of troubleshooting steps that will resolve most iCloud connection issues on Mac. How to Fix “This Mac can’t connect to iCloud” and Unknown Errors with iCloud on Mac This set of iCloud unknown errors and problems is not exactly rare (see 1, 2, 3) and can be notoriously quirky to resolve, but the steps below should remedy these type of iCloud login issues on a Mac if they are seen.