If you have failed Memtest testing, then there is a memory problem. It could be a physical issue with the memory or a configuration problem. It could also be a problem with the motherboard or CPU.
First, try doing a hard reset of the BIOS settings as follows.
Power off the unit, switch the PSU off and unplug the PSU cord from either the wall or the power supply.
Remove the motherboard CMOS battery for five minutes. During that five minutes, press the power button on the case for 30 seconds. After the five minutes is up, reinstall the CMOS battery making sure to insert it with the correct side up just as it came out.
Now, plug the power supply cable back in, switch the PSU back on and power up the system. It should display the POST screen and the options to enter CMOS/BIOS setup. Enter the bios setup program and reconfigure the boot settings for either the Windows boot manager or for legacy systems, the drive your OS is installed on if necessary.
Save settings and exit. If the system will POST and boot then you can move forward from there including going back into the bios and configuring any other custom settings you may need to configure such as Memory XMP profile settings, custom fan profile settings or other specific settings you may have previously had configured that were wiped out by resetting the CMOS.
Try one stick of memory in ONLY the A2 slot, which is the second slot away from the CPU socket. Run 4 passes of Memtest86. If it does not pass testing remove it, install the other stick of memory and test again. If it still does not pass.
Memtest86
Go to the Passmark software website and download the USB Memtest86 free version. You can do the optical disk version too if for some reason you cannot use a bootable USB flash drive.
Create bootable media using the downloaded Memtest86 (NOT Memtest86+, that is a different, older version and is outdated). Once you have done that, go into your BIOS and configure the system to boot to the USB drive that contains the Memtest86 USB media or the optical drive if using that option.
Click here to download Memtest86 USB package
Create a bootable USB Flash drive:
1. Download the Windows MemTest86 USB image.
2. Right click on the downloaded file and select the "Extract to Here" option. This places the USB image and imaging tool into the current folder.
3. Run the included imageUSB tool, it should already have the image file selected and you just need to choose which connected USB drive to turn into a bootable drive. Note that this will erase all data on the drive.
No memory should ever fail to pass Memtest86 when it is at the default configuration that the system sets it at when you start out or do a clear CMOS by removing the CMOS battery for five minutes.
Best method for testing memory is to first run four passes of Memtest86, all 11 tests, WITH the memory at the default configuration. This should be done BEFORE setting the memory to the XMP profile settings. The paid version has 13 tests but the free version only has tests 1-10 and test 13. So run full passes of all 11 tests. Be sure to download the latest version of Memtest86. Memtest86+ has not been updated in MANY years. It is NO-WISE as good as regular Memtest86 from Passmark software.
If there are ANY errors, at all, then the memory configuration is not stable. Bumping the DRAM voltage up slightly may resolve that OR you may need to make adjustments to the primary timings. There are very few secondary or tertiary timings that should be altered. I can tell you about those if you are trying to tighten your memory timings.
If you cannot pass Memtest86 with the memory at the XMP configuration settings then I would recommend restoring the memory to the default JEDEC SPD of 1333/2133mhz (Depending on your platform and memory type) with everything left on the auto/default configuration and running Memtest86 over again. If it completes the four full passes without error you can try again with the XMP settings but first try bumping the DRAM voltage up once again by whatever small increment the motherboard will allow you to increase it by. If it passes, great, move on to the Prime95 testing.
If it still fails, try once again bumping the voltage if you are still within the maximum allowable voltage for your memory type and test again. If it still fails, you are likely going to need more advanced help with configuring your primary timings and should return the memory to the default configuration until you can sort it out.
If the memory will not pass Memtest86 for four passes when it IS at the stock default non-XMP configuration, even after a minor bump in voltage, then there is likely something physically wrong with one or more of the memory modules and I'd recommend running Memtest on each individual module, separately, to determine which module is causing the issue. If you find a single module that is faulty you should contact the seller or the memory manufacturer and have them replace the memory as a SET. Memory comes matched for a reason as I made clear earlier and if you let them replace only one module rather than the entire set you are back to using unmatched memory which is an open door for problems with incompatible memory.
Be aware that you SHOULD run Memtest86 to test the memory at the default, non-XMP or custom profile settings BEFORE ever making any changes to the memory configuration so that you will know if the problem is a setting or is a physical problem with the memory.