[https://www.minitool.com/android-recovery/android-black-screen-of-death.html|Black screen] could be a sign of LCD damage.
There is also a chance that your battery may be damaged and improper current flow is leading to phone turning off automatically. It is really easy to see battery status using a secret dialer code.
Also try another cable and charger before a battery replacement.
If you encountered the issue with a specific application, then it could be a problem with the software of your phone, try to uninstall or reinstall the apps.