Samsung’s advice does not focus on security. But when you reboot, any spyware or other malware running in your phone’s memory ...
An iPhone that keeps restarting is a serious but uncommon problem. If you can, back up your iPhone's data to iCloud or your computer so you don't lose all your personal data if catastrophe strikes.