Screen glitch and continuous shutdowns: How to fix it?

In 2017 I used to take my tablet to class in my backpack. It worked fine, but over the years the screen would freeze, glitch, or turn off for no reason. Even formatting it didn't help. Does anyone know what it could be?

crwdns2934089:0crwdne2934089:0 crwdns2934093:0crwdne2934093:0

crwdns2934109:0crwdne2934109:0

crwdns2889612:0crwdne2889612:0 0
crwdns2934285:0crwdne2934285:0