I don't disagree with @Ryanber201's post.
The 2013 MBP is well obsolete. You could spend resources - time and money - fixing it, but the computer wants to retire. Today the problem is that it shuts down randomly. Tomorrow you'll discover that the software support has dried up. In fact, Apple stopped supporting macOS Catalina a few years ago, and many other publishers have stopped supporting that OS with their browsers, office applications, device drivers and other apps and software.
To me, the shutdowns seem indicative of a hardware issue. Apple and their Authorized Service Providers won't service the laptop because new parts are no longer available for an obsolete computer.
You would be wise to do your research and find a replacement for this old Mac. Look for something that is no older than four or five years. It isn't difficult to get ten years of good service from a Mac.