How can I stop my Nexus 5X getting stuck in the loading screen?
To turn the device off, when it's in the bootloop phase, just hold down the VolDown key until the device restarts and takes you to fastboot. From there, you'll be able to choose the option to turn off.

Hope it's still a useful answer.