2nd hand mac purchased, can't load os x
Buy an older version of OSX on CD

How to install Mac OS X without OS X Recovery or the DVD that came with the Mac?

or

Install Linux on your Mac

http://www.macworld.co.uk/how-to/mac/how-install-linux-on-mac-3637265/

(excerpt)

"Here's how to go about installing Linux on a Mac"

Download your Linux distribution to the Mac. We recommend Ubuntu 16.04.4 LTS if this is your first Linux install. Save the file to your Downloads folder.

Download and install an app called Etcher from Etcher.io. This will be used to copy the Linux install .ISO file to your USB drive.

Open Etcher and click the Settings icon in the top-right. Place a tick in Unsafe Mode and click Yes, Continue. Then Click Back.

Click Select Image. Choose ubuntu-16.04.1-desktop-amd64.iso (or the image you downloaded in Step 1).

Insert your USB Thumb Drive. A reminder that the US Flash drive will be erased during this installation process. Make sure you've got nothing you want on it.

Click Change under Select Drive. Look carefully and pick the drive that matches your USB Thumb Drive in size. It should be  /dev/disk1 if you only have a single hard drive in your Mac. Or /dev/disk2, /dev/disk3 and so on (if you have more drives attached). Do not pick /dev/disk0. That's your hard drive. Pick /dev/disk0 and you'll wipe your macOS hard drive You've been warned!

Click Flash! Wait for the iso file to be copied to the USB Flash Drive.
Remove the USB Flash Drive from your Mac.

Shut down the Mac you want to install Linux on and attach the USB stick.
Power up the Mac while holding down the Option key.

Choose the EFI Boot option from the startup screen and press Return.
You will see a black and white screen with options to Try Ubuntu and Install Ubuntu. Don't choose either yet, press "e" to edit the boot entry.
Edit the line that begins with Linux and place the word "nomodeset" after "quiet splash". The whole line should read: "linux /casper/vmlinuz.efi            file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash nomodeset --. (See screenshot, below.)

Press F10.

Ubuntu boots into trial mode.

Double-click the icon marked "Install Ubuntu".

Select English and choose Continue.

Select "Install this third-party software" option and click Continue.

Click Yes to the /dev/sdb alert.

Select "Erase disk and install Ubuntu" and click Continue.

Ensure that Select Drive is displaying the main hard drive. Click Install Now. Click Continue in the alert window.

Select your location on the map and click Continue.

Choosing your keyboard layout and click Continue.

Enter the name and password you want to use.

Click Continue and Linux will begin installing.