Samsung tablet locked with power on
Resetting the device will do the job. But you'll lose all your data. There's also a risk of google account authentication requirement on reboot after you format in certain devices involved so continue at your own risk.
Here's how to do it:


Press and hold the power button for 8 seconds, and the device will power off automatically.
Reboot the device by pressing and holding Volume down + Power button at the same time 
Now, you can format your device from the recovery mode. Navigate with the volume keys and choose wipe data/factory reset. Press the power button to confirm.
Your device will reboot after formatting just like a new device and logging in back to your Google account will restore most of the data if you had backed up before.