As you have already done a factory restore. The next step would be to download Windows from MS. Create a bootable USB flash drive to install Windows. Using the
Media Creation Tool. Then wipe the drive and perform a clean install.
You can also create a Linux live USB. Ubuntu is probably the easiest to get
setup. See if your problems exist in Linux.
Also make a bootable rescue USB with
Hiren's BootCD PE. Run Memtest86+ from the boot options. RUFUS is a good utility for making a
bootable flash drive. You may need to enable Legacy boot options in your BIOS.
As you've already done a factory restore. The problem is more likely hardware related not software (drivers). Memtest86+ will check your system RAM just in case. Although the more likely culprit would be your GPU or VRAM.