How to restart, quit frozen application and reset iphone

Hi friends,
I need to know how to reset, quit frozen apps and reset my iphone. As I was just listening to music in my iPhone's iPod application, my phone was completely locked up at the end of a tract, with an almost faded out display and worse my iPhone became completely unresponsive.
The display wouldn't accept any of my taps, even external button was ignored.
Thanks.
