Power button is an hardware problem not a software, if your phone power button not working properly than you have two options repair or buy a new phone, of course no one want to a buy a new phone because of power button, I have third option, just use a simple app which work exactly like a power button “Volume Unlock Power Button Fix” is an app designed for phones and tablets with faulty or broken power buttons, this is really nifty app running on your Android, you can use the volume button instead of the power button to wake up your device, let see how to use this.
1. Go to play store download and install this app
2. Open the app, first time it will ask for activation, so tap on “activate” turn on “volume lock” and turn on “Permit usage access” after this come back to main screen
3. Now turn on “Enable volume unlock” and “Screen off”, to turn off screen, drag down the notification and tap on “Turn off Screen” your phone will be lock, to unlock the phone just press “volume button”