Usually, the Power button fails to work due to a system glitch ... You can use the command-line shutdown options in this case. So, open the Command Prompt as an administrator and then use one ...
On the Power Options page, click on the Change plan settings ... After making the proper changes, select Apply, and then hit the OK button. Restart the laptop. NOTE: Manayer says in the comments ...