Pull the battery out (if it has a removable battery) and leave it out for a couple of minutes. If you can't do that, press the power button and hold it down for 15-20 seconds until the phone restarts. Then let us know if it's no better - though if it still does the same you've probably got a hardware fault that needs repair.