How to fix Hp pc if it goes into power saving mode

You can go to the power options and change the power plan you have to what you want.
When a Pc goes into the power saving mode the screen will go black because in the power plan there is a setting for it to shut the display off after so many minuites being idle. There are a lot of options that you can change or adjust in the power saving plan page.

Control panel > System and Security > Power Options and if you want a detailed selection you can select the advanced button. In the advanced page each line has an option or several options.