Log into Terminal as an administrator, for example: ssh admin@mycomputername.local (replace admin with the short name of an administrator account, and mycomputername.local with your computer's Bonjour name (see the Sharing preference pane).
Enter the admin password when prompted. If you get a message that the system can't verify the identity of the computer and asking you if you want to proceed, type yes. Once logged in, you can try any Terminal command and see if it works. Usually, I just type sudo reboot and enter the admin password when prompted.
It's worth a try when it seems that nothing but a cold, hard, power-off restart will work.

