Running iMac 2009 on external screen due to Broken LCD So I would like to know if it is possible to diagnose and install new OSX using blank SSD in an iMac that has broken LCD and no hard drive?

I bought this iMac out of auction where you cant test anything and buy as-is, and looks like I'm in deep trouble as the display doesn't work and it has no hard drive. The iMac chimes with Apple sound when turned on so that tells me motherboard is working.
Yes it is possible to diagnose and install macOS on an iMac with a broken LCD and missing hard drive.

The iMac all-in-ones from that vintage has a mini Display Port for a second display.  It supports Leopard through El Capitan.  Here’s what you’ll need at a minimum:


A mini display port to VGA, DVI, or HDMI adapter, depending on the monitor you’re hooking up to.
A bootable USB - either an installer or a USB with a full installation on it.  You can create an installer by following one of the many guides found online.  If you want to use the full install, you’ll need to install macOS to a USB flash (64GB is sufficient) or a USB hard drive.


As for a keyboard, I’m assuming it comes with one, but if it doesn’t, you don’t need an Apple one; a cheap USB keyboard will work fine. Just remember, the “Windows” and “Alt” keys are the Command and Option keys, respectively.