Do not shut down your computer by cutting power to it. That can cause filesystem corruption.
It’s about as graceful as banging your head against the wall when you can’t get to sleep, instead of taking a sleeping pill. It may work a few times, but eventually, it will cause damage.
Instead, when you computer is frozen, you can restart it using the Magic SysRq key: