How am I supposed to install El Capitan on a new SSD without recovery partition? My old mac's hdd died. It's dead. So I got a ssd and installed it in the macbook.

Now how do I get El Capitan on there? I find lots of tips online that speak of creating a bootable USB drive from the Capitan installer. But I can't download the El Capitan from the appstore because the mac has got nothing to boot from.

On my newer macbook running Catalina, I also cannot download El Capitan from the appstore because it doesn't show up when searching for it.

What I did download is El Capitan's InstallMacOSX.dmg via https://support.apple.com/en-us/HT206886

But now I need to run/open this on the old mac with the fresh ssd.

I feel I'm stuck in a loop. I need a working OS to install an OS.....

Who can help me out here?
You said you downloaded the installer. Did you download it to another Mac? If so, mount the .DMG, copy the install file to the Applications folder, then follow this documentation:

https://support.apple.com/en-us/HT201372

Once the new SSD is installed, and you've created the bootable USB drive - insert USB drive into the Mac, start it up holding the alt (option) key, and select the Install El Captian drive.

Format the SSD from Disk Utility, then install.