Mine stopped working 3 weeks ago. It doesn't " click " OFF or ON anymore. It happened without warning.
Now I will tell you how you can deal with it since this power button will no longer work unless you have your device replaced or fixed. It's a common problem with these phone to loose the power button fonctionality.
In order to power off your phone or to put it in sleep mode you will need to enable the assistive touch in accessibility. ( Settings > general > Accessibility > Assistive touch " switch it ON )
You will see a bright dot on your screen and it will give several options ( Device, siri, home, favorites ) When you click those it does the same thing than physical button. EX : click " device " will give you the choice to lock the screen. If you leave you finger you lock screen long enough it will power off the phone. To power ON your phone simply connect it to your charger or computer.
If you are sick of that bright dot showing on your screen you can make it disapear.
Go back to ( settings > general > accesibility > triple-click home ) select the option ( assistive touch )
Now everytime you need to power off or lock your screen you will simply triple-click your HOME button and assistive touch will appear. If you need to get rid of assistive touch , triple-click again on HOME button and assistive touch will disappear