Is it that the screen turns off or the phone powers down.
If its the screen turns off. Just check, if you go into settings, then display. Go down to screen timeout and see. Normally set for one minute, but you can change this.
Also go into settings. Device and battery care.
Tap on the 3 dots on the top right.
Go into Automation and see if auto restart at set times is on. If it is try turning that off.
Seems to cause issues for some