1. Download El Capitan installation from the App store. It might complain that you already have it installed but download it anyway. It will be downloaded to /Applications and be named Install OS X El Capitan.app
  2. Create a bootable image from the El Capitan installer on a USB stick larger than 6GB. In a terminal run:
sudo /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/createinstallmedia --volume /Volumes/MyVolume --applicationpath /Applications/Install\ OS\ X\ El\ Capitan.app

where MyVolume is the name of your USB stick. Change this to match the name of your USB stick.

  1. Physically install SSD into the target laptop.
  2. Insert the El Capitan USB stick into the target laptop and power up. (This might take a while.)
  3. When the menu finally turns up, choose Disk Utility and format the SSD as Mac OS Extended (Journaled) with a unique name.
  4. Once complete, exit from Disk Utility and return the main menu.
  5. Choose to Install OS X on the formatted SSD.
  6. Follow the prompts until El Capitan is installed.

Here’s link to a video on how to physically install the SSD as well as run the software installation.

If you’d rather install Yosemite on the SSD then follow the How to Install Yosemite on a New SSD guide.