I have a MacBook Pro 13", Mid-2009 and it came with Mac OS X 10.6 Snow Leopard. As I understand it, that means I would have to use the DVDs provided by Apple to boot into Apple Hardware Test. The problem is I don't have my optical drive anymore since I swapped it out for an extra HDD. How can I run the Apple Hardware Test?
This answer Diagnosis or Hardware Test on a mid 2009 Macbook Pro with MacOS 10.9.2 discusses a GitHub page https://github.com/upekkha/AppleHardwareTest which has assembled various versions of the AppleHardwareTest which you can download and install in a specific place on your harddisk. This allows you to run the test without a working CRROM.
It worked for me on a Mid 2009 Macpook Pro.
If you have the recovery partition there is a way to do from the partition : Using Apple Hardware Test (Apple.com)
Just press D at the boot chime.
If the model of MacBook Pro that you're using does not support the Internet version of AHT and/or does not have an AHT partition on the drive, another Mac that does have an optical drive can be used to copy the Applications Install Disc onto other media (including SD cards, USB flash drives, and external hard drives).
Using Disk Utility's "Restore" feature, you can restore the Applications Install Disc that came with your Mac onto an SD card, USB flash drive, or external hard drive. After restoring the DVD image to another disk, you can startup from the AHT partition by holding the "D" key at boot (while that disk is connected).
Note: this will require you to erase the external drive that you're restoring the Applications Install Disc (AHT) to.