How do I restart my iPhone and why should I?

Often people talk about restarting an iPhone in the same way you restart a computer.

How do you do this, what buttons do you press?

Also how/why is this different to just turning off the iPhone using top button and then turning it back on?

You can restart the iPhone by holding the power button and home button for about 5 seconds (until you see the apple logo pop onto the screen). You may have to do this if the phone freezes, or otherwise becomes unresponsive. http://www.apple.com/support/iphone/assistant/phone/#section_2

Holding down the power and home button for about 5 seconds will perform a hard reset. Restarting your iDevice frees up used RAM. Low RAM is the main reason apps crash, which is why it's suggested to restart your iDevice every once in a while.

Pressing the top ("Lock") button locks the phone and turns off the display. That is useful for saving power and for security.

Turning the phone off can be accomplished by holding down the Lock button until the red arrow button displays saying "slide to power off". Turning off the phone in this manner will allow any running processes / services to shut down gracefully. This is akin to shutting down your Mac. Shutting down your iOS device every few days will free up leaked memory and may help it to work better or faster. I shut my phone off nearly every night, then plug it into the wall charger which turns it back on automatically.

Holding down the power and home buttons until the device restarts itself is called a "hard reset" and is akin to pressing and holding the power button on a Mac. Restarting in this manner does not give running processes a chance to shut down gracefully and may in fact result in lost data. This technique should be a last resort, not a daily practice because of its potential ill effects.