Open a Command Prompt or PowerShell window and use the built-in Windows shutdown command:
shutdown /s /t 0 -- Shut down immediately
shutdown /r /t 0 -- Restart immediately
shutdown /l -- Log off the current user
shutdown /s /f /t 0 -- Force shut down immediately, closing all applications
The /t 0 parameter sets the timeout to zero seconds so the action happens right away.