Any good memory test for newer Macs (2015 and later)
Use Apple Diagnostics. Its an Apple-approved method of checking your memory and other hardware parts of your Mac. You can restart your Mac, then hold down D as soon as it restarts. If you did it correctly, your computer will either boot into Apple Diagnostics or Apple Hardware Test, depending on the age of your machine. Then just follow the prompts.