Give it time to cool off. The same thing happened to my computer before. I just waited a little while, and then it worked again. Also, you should get a fan to put under your laptop. ( I'm assuming it's a laptop you're talking about.) That should help not letting it get overheated again.
You need to make sure that the bottom of the laptop is not blocked, so that there if free-flow of air below and in the direction of the exhaust fan. You could also make sure that the fan vents are not plugged with dust.