If your Mac had macOS 10.12.6+ installed at some point in the past, then you should be able to boot the Mac into Internet Recovery Mode using Command + Option + R to access the online macOS installer (should be macOS 11.x Big Sur, but sometimes it may only access the online installer for the OS which originally shipped with the Mac from the factory).
The version of macOS installer being used you will determine how you will prepare the drive using Disk Utility. For installing macOS 10.10 or earlier, you will need to partition & format the whole physical drive using the instructions in this article:
https://eshop.macsales.com/tech_center/formatting/Mac_Formatting_6-10_R3.pdf
If installing macOS 10.11 to 10.13, then use Disk Utility to erase the whole physical drive as GUID partition and MacOS Extended (Journaled).
If installing macOS 10.14+, then use Disk Utility to erase the whole physical drive as GUID partition and APFS (top option).
With macOS 10.13+, within Disk Utility you may need to click "View" and select "Show All Devices" before the physical drive appears on the left pane of Disk Utility.
If you have access to another Mac from 2008 to 2020, then you can use it to create a bootable macOS USB installer using the instructions in this Apple article:
Create a bootable installer for macOS - Apple Support
FYI, the other Mac you have access to will determine which versions of macOS you can create a USB installer for since the other Mac must be compatible with the OS installer you want to create. You can find which versions of macOS are compatible with various Apple hardware by using this article (as long as the OS shows up for both the 2014 Mac and whatever other Mac you have access to, then you can create that version of macOS USB installer):
https://eshop.macsales.com/guides/Mac_OS_X_Compatibility