First, go to /users/justin/documents/arduino/libraries and delete anything you copied there. That "libraries" folder is a special location. Putting normal program there could cause problems. So before you go any farther, look in that folder and delete any folders and files you put there.
Quit and restart Arduino IDE, just in case it's remembering anything about stuff that was incorrectly placed in that libraries folder.
Then in Arduino, click File > New Sketch. You'll get a new window with a sample program that has 2 empty functions called setup() and loop(). Delete all that, so the window has nothing. Then go to this page on github for the memory test code.
https://github.com/PaulStoffregen/teensy41_psram_memtest/blob/master/teensy41_psram_memtest.ino
Select all 147 lines and then copy to clipboard, either with CTRL-C (or Command-C if MacOS) or menu Edit > Copy. Then in blank Arduino window, where you deleted the sample do-nothing program, paste with CTRL-V or Edit > Paste. You'll see all 147 lines of code appear in the Arduino window. Then quickly check Tools > Board to make sure Teensy 4.1 is selected, and click the Upload button (2nd from the left in the green menu bar, shown with a right arrow).
After the code is uploaded, click Tools > Port to quickly check that your Teensy board is selected. Then open the serial monitor window, which can be done by clicking the button on the far right side of the green menu bar, or with the menu Tools > Serial Monitor. If using the older Arduino IDE 1.8.x this opens another window. If using newer Arduino IDE 2.0.x, the serial monitor opens as tab in the bottom part of the main window. Either way, you should see the memory test results.
If you want the program stored on your PC, in Arduino use File > Save As. It will give you a normal file save window with the proper location where Arduino expects to find saved files.
Hopefully this helps you get past this initial hurdle and run the memory test. If you get stuck or something goes wrong, please remember we can't see your screen. Helping over the internet like this goes so much better if you show us a screenshot, so we can see whatever error message is on your screen, together with details like the tiny text that appears in the bottom part of the Arduino IDE window.