Install OS X on replaced blank SSD in iMac
The 2009 iMac does not support Internet Recovery, so you'll not be able to download and install Mac OS X directly from the iMac without any external installation medium.

You'll to acquire the installation DVD, insert it into the drive and power on the Mac while holding down the C key on the keyboard.

If you have another Mac, you could possibly download the installation DMG from the App Store and burn it to a DVD or transfer to a USB drive for the iMac.

Another option would be to request the installation discs in an Apple Store - if they still have a supported OS for sale.

A third option is to use eBay or similar to purchase a used installation disc.