How to shut off my iphone if lock button is broken?

I hit reset phone and clicked delete everything and it's been loading for a super long time and so I want to shut it off but the thing is the power button doesn't work…

You don't.

Go on to the settings and turn the assistive touch button on (If you don't know how http://www.hongkiat.com/blog/iphone-assistivetouch-on-off/)… That gives you different options for all the buttons… Eg volume, home, lock

Hope this helps.

Yea it takes a long time to restore itself. You can't shut it down, let it finish its work.