You need to boot into Recovery Mode using Command + Option + R to attempt to access the macOS 10.15 Catalina (for an Early-2013 model) or macOS 11.x Big Sur (for Late-2013 model) online installer. Unfortunately some Macs may only boot to the older online installer for the version of macOS which originally shipped with the computer from the factory......many people have been reporting Apple's servers are not always available for the older operating systems and/or older hardware.
If you have issues accessing Internet Recovery Mode, then you can create a bootable macOS USB installer using another compatible Mac (for macOS 10.11 make sure to carefully read the instructions on how to download & extract the El Capitan installer since there are multiple steps required before a USB installer can be created for macOS 10.11 El Capitan). Here are the generally compatible models for various versions of macOS (that compatible Mac can currently be running any version of macOS from 10.6+):
For a Late-2013 model, to create a bootable installer for:
- macOS 11.x Big Sur, you need a Mac from Late-2013 to 2020 (or mid-2021)
- macOS 10.15 Catalina you need a Mac from 2012 to 2019
- macOS 10.13 High Sierra you need a Mac from Late-2009 to 2017 (may mid-2018)
- macOS 10.11 El Capitan you need a Mac from 2007 to 2015
For an Early-2013 model, to create a bootable installer for:
- macOS 10.15 Catalina you need a Mac from 2012 to 2019
- macOS 10.13 High Sierra you need a Mac from Late-2009 to 2017 (may mid-2018)
- macOS 10.11 El Capitan you need a Mac from 2007 to 2015
You can use the information in the following article to confirm the other Mac is compatible with one of the versions of macOS I have just listed for the (Early 2013) and (Late 2013) models:
https://eshop.macsales.com/guides/Mac_OS_X_Compatibility
FYI, on an Intel Mac it is best to erase the whole physical SSD so that it creates a new partition table & fresh file system. Within Disk Utility you will need to click "View" and select "Show All Devices" before the physical drive appears on the left pane of Disk Utility. Select the top most item which is the physical drive which usually shows the make & model of the drive such as "Apple SSD AP250.....".
The file system you need to use will depend on the OS being installed. Erase the physical drive as GUID partition and APFS (top option) when installing macOS 10.15 or 11.x, otherwise erase the physical drive as GUID partition and MacOS Extended (Journaled) if installing macOS 10.11 or 10.13. Make sure to give the volume a proper name since it is not easy to properly rename the macOS boot volume when using macOS 10.15+ due to the newer more complicated drive layout being used....the default volume name from the factory is "Macintosh HD".
Edit: To properly identify the exact model of your Mac now that it has been erased, you can enter the system serial number on the Apple check coverage page here:
Check Your Service and Support Coverage - Apple Support