Recently, I've had quite a few friends asking me what to do when their iPhone crashes or locks up in a way that prevents the iPhone from responding to the normal iPhone restart procedure. This happens occasionally with jailbroken iDevices whenever there are cydia app conflicts with the firmware. Typical symptoms are having the iDevice going into an endless boot loop or having the screen stuck at the Apple logo.
Reset the iPhone by holding the sleep/wake button (the 'Power Button') at the top right of the device and the home button (the 'Circular Button') at the bottom center of the face at the same time. Hold them both until you see the screen go black and the white Apple logo appear. When this happens, you can let go - the iPhone is rebooting. Sometimes, I've had to reset several times before the iDevice goes back to the homescreen. Once you reach the rebooting sequence (where you see the spinning graphics), you should wait for the reboot to complete and this may take up to a minute. If nothing happens or if the spinning graphics stops for more than a minute, there could be a system hang and I would try to reset again.