There can be several causes as to why your Mac might stop responding.
To start diagnosing your Mac, I believe you should create an EtreCheck report. EtreCheck is a simple, helpful utility to diagnose and identify both software and select hardware issues.
If your Mac is experiencing an issue, such as poor performance or running slowly, kernel panics, apps freezing or quitting unexpectedly, storage issues, and many more, generating an EtreCheck report is a great place to start for troubleshooting issues with your Mac while getting help at Apple Support Community. EtreCheck was developed by a highly respected member of these very Apple Support Community forums, and it is trusted by many users.
Downloading
To get started, download EtreCheck:
https://etrecheck.com/en/welcome.html
Click “download” on the site. The app will be downloaded to your Mac to your downloads location, which is the “Downloads” folder by default. This can be accessed by going to the Finder > Go (in the top menu bar) > Downloads.
Open the app, and generate a report
Open the downloaded application, and follow the initial steps to open the app. Choose a problem in the drop-down menu, and click Start. Creating a report typically takes 2-4 minutes on a healthy Mac.
View your report, and upload a copy to Apple Support Community
Once you have your report generated, you can upload it to Apple Support Community for us to review and provide suggestions. Please refer to this document with instructions for uploading your report and using the “Additional Text” function of Apple Support Community:
How to use the Add Text Feature When Posting Large Amounts of Text, i.e. an Etrecheck Report - Apple Community.
If you need help in the meantime, please let us know!
Jack