Hello!
You need a Mac OS X Snow Leopard install disc which you can use to erase your Mac. You can then use the Mac OS X Snow Leopard installation to upgrade to OS X El Capitan, the newest version of the Mac operating system for your Mac.
These Mac OS X Snow Leopard install discs can be found on third-party sites, such as eBay. When buying one, make sure you're buying an authentic Apple version.
Once you have a Mac OS X Snow Leopard installer, shut down your Mac, turn it back on, then insert the press and hold the "option" key immediately after. Insert the install disc, then choose "Install Mac OS X Snow Leopard".
Once booted to the install disc, choose Utilities > Disk Utility from the menu bar. Choose the main hard disk at the top of the hierarchy in the "Internal" section. Its name will end in "Media". Select it, then choose the "Partition" tab.
Look for a "Partition Layout" dropdown. From that menu, change it to "1 Partition" from "Current". Next, change the name to "Macintosh HD" and format to "Mac OS X Extended (Journaled)". Choose Options, and make sure "GUID Partition Map" is selected. Click Done, then Apply. Quit Disk Utility.
At this point, you will be returned to the installer. Follow the steps to install Mac OS X Snow Leopard on your internal disk. Installation may take some time.
Once Mac OS X Snow Leopard is installed and set up, download OS X El Capitan here:
How to download macOS - Apple Support
A downloaded DMG file will be placed in your Downloads folder. Open it, then open the application installer attached. This will place an app titled "Install OS X El Capitan" in your Applications folder. You can then open it, follow the steps, and upgrade your Mac to OS X El Capitan.
You now have OS X on your Mac again.
Jack