Actually, the power button is simple. What is complicated is what the computer does when it gets a signal. Typically, when the circuit is completed, the following occurs:
If the computer if off, a signal turns the computer on
If the computer is on, a signal tells the OS you pressed the power button. The OS then will either shutdown the computer or prompt you with what action you want to take
If the computer is on, and a signal is received for 5+ seconds, the computer powers off manually, bypassing the OS
The first two only require the circuit to be completed. I've turned my computer on mid-build by simply touching a car key to both pins for the power switch. Any metal object can be used as a makeshift power switch. Alternatively, any power switch you buy at a hardware store can be used on a computer. Beware however that most such power switches are toggles: they'll stay on once pressed or switched until pressed again or switched back into the off position. In other words, if you got a push-button switch like this, you'd actually want to click twice. The first click would complete the circuit and send the signal to power on, and the second click would open the circuit which will prevent the power switch from sending a continuous signal, which may end up turning off the computer much to your dismay