I presume you have a non-removable battery, in which case press and hold the power button to force a restart (if you have a removable battery then pull it out for a couple of minutes).
If that doesn't fix it then you can get into the bootloader by forcing a restart then pressing and holding volume down as it restarts. From there you can enter recovery and do a factory reset.
If even that doesn't fix it you need to reflash the device or get it repaired (depending on what is causing this - we'd need more information to guess at that).