1 - You download software. There is Mac App store. You can also download from other sources but you have to change setting to install.
2 - You boot into the recovery partition. See:
Macs from the last couple of years or so have been able to boot from firmware and then download the original operating system over the Internet.
You can also make your own boot disk, see http://liondiskmaker.com/