@amanuelshiferaw we are now making the assumption that it is not overheating but that you get a false message. First thing I would suggest to do a hard reset. You must backup all your files/pictures/etc since you will lose those. After that, proceed by following the hard reset as listed [https://www.hard-reset.org/factory-default/how-to-easily-master-format-samsung-galaxy-a2-core-sm-a260f-sm-a260g-with-safety-hard-reset/|on here] REMEMBER TO BACKUP!
If that did not work, replace your battery and check the charging port on your circuit board. Both of those can cause this error at well. Let us know what you find out. [https://www.youtube.com/watch?v=qR6JJ7zb5mU|this might] work for you