It's best to prep the new drive externally as long as your internal drive is working.
But before you start get a few USB Thumb drives and make copies of anything important.
Put your SSD into the case and plug it into your running system. Then use Disk Utilities in the utility folder to partition and format the drive if you have an older OS version (Snow Leopard) and then run the OS installer.
If you have a newer OS run the OS installer so it can not only prep the SSD but install the hidden recovery partition and OS.
Once the drive is ready, Use the Option key went you restart the system to then select the SSD as the boot drive. At that point the SSD should be running the show. If so you only need to alter the Startup Disk control panel to make it permanent and you're then ready to swap the drives.
If not you'll need to review the steps and try again.