Before you shell out money on new RAM, some basic troubleshooting might resolve the issue. Here are some easy ways you can troubleshoot bad RAM.
Double-Check
RAM is held in place by hinged clips at either end of the RAM socket. If the clips aren't fully engaged, the RAM might not be properly seated, which could cause issues.
Double-check that your RAM is correctly seated. Power down your PC and unplug it. Then release the clips holding the RAM, and remove each module.
Reinsert the RAM in each socket and push it firmly into place. The clips will engage automatically and should click. Push them inward just in case.
Dirt or damage to the RAM contacts can cause issues. Remove the RAM carefully and inspect the bottom edge for damage or dirt.
The contact plates should be flat and uniform. If the contacts are dirty, clean them with a soft, dry cloth.

Test
One of the two RAM modules could be broken and might need to be replaced.
The best option is to see if your PC boots up with one. If it works, you can return the other for a replacement if it's still under warranty.
It's also possible the sockets on the motherboard are broken. In that case, check with the motherboard manufacturer and see if there is a refund available.
You can test for faulty RAM modules with a memory diagnostic tool. Windows has a built-in tool.
A more robust tool is Memtest86; it has a much easier interface to see specific errors.
Run your chosen diagnostic tool and check the results in the interface or error log. If it identifies a faulty RAM module, remove it and re-check to see if the error has gone away.

Reset
The BIOS or UEFI in your computer is responsible for several key boot functions, including hardware initialization.
It is not unheard of for parts of the boot process to develop errors, particularly after flashing the BIOS or changing settings.
This can result in RAM not being detected by your OS. The easiest way to fix this is by resetting the BIOS/UEFI.
You can do this in several ways, starting with booting into the BIOS menu and looking for the option to Load Setup Defaults or Reset All Settings.

Wrapping Up
Make sure the RAM is clean and placed in the sockets securely.
Test for bad RAM by booting them up one at a time, or use dedicated software like the Windows Memory Diagnostic Tool or Memtest.
And verify that your BIOS settings are correct, you may need to reset things if necessary.