As a rule of thumb - Always rule out hardware first. Use software to check the smart status of the primary hard drive, as it's the most common component to fail. Crystal disk info is free for Windows, or my preference is to boot a live installation of Linux from a USB disk or DVD and use the disk information tool built in to pretty much any Debian based distribution. Linux mint will feel very familiar to any Windows use.
If the disk is bad or pre fail (bad sectors, failed reallocation), replace it. If not, test the memory next. Memtest 86 is a common tool to use, though you need to let it run for at least several hours, to up to a full day. Overnight is usually sufficient. Many motherboard and pc manufacturers bake some kind of memory test into the firmware, which you can access by pressing the correct key when you first power on the PC. It's usually an F-key, F1-F12, and may be listed at startup "press F12 to enter setup, press del for tools" etc. Sometimes these include disk utilities as well as other hardware diagnostics.
If hard drive and memory test out, I prefer to rule out a software issue in Windows by testing another OS for stability. If it doesn't ever crash in a Linux distribution or clean install of Windows, you're looking at a software issue, most likely a driver. If it crashes despite being a separate installation, you may want to consider replacing your computer, as the issue is either the processor or the system board. If it's in warranty from the manufacturer, get them to replace it, just pull your hard drive or make a copy with software like acronis for Windows or DD in Linux, or at least backup your important files to an external disk or cloud storage.
If you built your own system you probably didn't need this guide, but if you're reading this check out the warranty on your individual components. 5-10 years is common, and parts like memory often have lifetime warranties.