You can write a program that locks up your computer in most any language, it's called a fork bomb. Of course, there are guards against the most basic versions these days, but the point still stands that there's nothing stopping you from writing an endless loop that takes up more and more resources.
You can open the browser dev tools on this very page, write in `while(1);`, hit enter and watch the tab freeze up.