@solulelenc52780 the first hing I'd try is to start it in Safe mode to rule out any faulty apps etc. If it functions properly in safe mode you know that it is one of your apps that is causing this.
Next you could try recovery mode and see if that resolves any software issue. If that does not work try download mode and see if an update resolves this. Use the information [https://www.asurion.com/connect/tech-tips/samsung-phone-keeps-restarting/#:~:text=Use%20Recovery%20Mode&text=Turn%20off%20your%20phone%2C%20then,you%20see%20the%20recovery%20menu.|from here] about how to get into the modes.
After that, I would strongly suggest a new battery since a faulty one can cause these symptoms as well. iFixit does not yet have any guides but use [https://www.sosav.com/guides/mobiles/samsung/galaxy-a21s/|these guides] to work on your phone.
While you work on your phone, take lots of pictures. Once you are done with it, take those pictures and create a guide for iFixit. That will help the next person that has the same problem as you do. It's easy and fun to create these guides. https://ifixit.com/Guide/new The iFixit community will appreciate this.
Repair is War on Entropy!