To resolve auto restart issue please follow below given steps:-
1. Check device in safe mode:- Using Safe Mode on a Samsung phone allows you to force the device to run the essential operating system, and disable most 3rd party applications. To enter in safe mode:- Press and hold the Power key, when Power off icon appears > Press and hold the power off icon. To exit safe mode restart the device.
If the issue still persist, kindly register your concern in Samsung Members app along with short video, screenshot and error log file(Samsung Members app > Get help > Feedback > Error report/ask question). Note: Please send device log files within 15 minutes of issue occurrence along with the exact issue details.