Here are some things to try if your computer either won't turn off or turn on.
If your desktop / laptop is frozen and refuses to turn off. Hold the power button on either the desktop or the laptop in for 10 seconds. That will force the machine to turn off.
If your desktop refuses to either power on or give you any display on the screen, simply unplug the power cord from the back of the desktop. Then press the power button 3 or 4 times. Then plug the power back into the desktop and try turning it on again.
If your laptop refuses to power on do one of the following depending if you have a removable or non removable battery.
Unplug the AC adapter from the laptop and take the battery out. With both of this things disconnected, press the power button on the laptop 3 or 4 times. Then reconnect everything and try turning the laptop on again.
Non removable battery
Unplug the AC adapter from the laptop and flip the laptop over. On the back of the laptop look for a small pin hole you can push and hold for 10 seconds using a paper clip. After doing that, plug the AC back in and try turning the laptop on again.