This article explains how to restart or shut down a Mac remotely using Screen Sharing. It also includes information about using the Remote Login feature. This information applies to Macs running macOS Big Sur (11), macOS Catalina (10.15), or macOS Mojave (10.14).
How to Instantly Log Out, Shut Down, or Restart a Mac
There are two ways to remotely access a Mac on your local network. The first is through the Screen Sharing feature, which is disabled by default.
To enable screen sharing on the remote Mac computer:
Open System Preferences. Go to the Dock and click the System Preferences icon, or go to the Apple menu and select System Preferences.