What I do is I update the phone regularly, be it google play or galaxy, I keep my internal memory till 30% and rest on sd card. I keep clearing memory I.e. flushing the ram, also every 1 day of the month clear wipe cache. Yes I do all this. Not only on this phone but in all Samsung phones.
Network issue? Does your area have good network coverage of the service provider? Also, check if SIM card is OKAY.
Your problem seems to be affecting just you, I do have one M51 at home, no problem at all, it runs just perfect. It's updated, have only the required apps.
Solution: You can reset Network settings. Or, if it doesn't works, then, take backup of your data, reset the phone to factory settings. Update the phone.
Dear Samsung Member,
Greetings from Samsung Customer Support!
Please visit this mentioned link to resolve your device heating issue: https://www.samsung.com/in/support/mobile-devices/why-the-device-heats-up-during-use/
To resolve your device hanging issue please visit this link: https://www.samsung.com/in/support/mobile-devices/how-to-restart-the-device-when-freezed-or-hanged/
For further assistance, register your concern in Samsung Members Application (Open Samsung Members Application > Get help > Send Feedback > Error report/Ask questions).
Thank you for writing to Samsung.
Samsung Customer Support