Put the phone into Safe Mode and then see what happens to see if it's a downloaded app causing this.
If you have Goodlock installed check this isn't causing issues.
Check in your phone settings because there is a setting that when activated reboots the phone at set intervals.
If this continues in Safe Mode then consider backing up, remove any sd card and factory reset.
A Samsung Experience Store or Samsung Service Centre can take a look.
Daily Driver > Samsung Galaxy s²³ Ultra 512Gb in Phantom Black.The advice I offer is my own and does not represent Samsung’s position. I'm here to help. " This is the way. "