Assuming that the specifications of your computer generally work with Minecraft, if you play with a mod-loader, I would try to test the mods installed one by one and see if there are any problems.
It might also be helpful to check whether your anti-virus software, especially ransomware protection, is affecting Minecraft in a certain way.
In your ".minecraft"; directory there is probably also a "crash-reports" and a "logs" folder after a crash, maybe you can find out the reason or source of the crash here.
I hope it helps you, or at least gives you an idea of what the error could be.