Try using Command + Option + R to see if you can access the online macOS Catalina installer. Unfortunately some Macs will only boot to the online installer for the older version of macOS which originally shipped with the Mac from the factory regardless of the keys used for booting.
Is this the Retina or non-Retina model?
15" or 13" model?
Without knowing more about the boot issue & what symptoms may have preceded it, my guess would be a failing internal hard drive or bad internal hard drive SATA Cable (the latter is very common on the 13" non-Retina model). I would suggest trying to run the Apple Diagnostics to see if any hardware issues are detected....unfortunately the diagnostics rarely detect issues. Plus with the 2012 models, many times there is a compatibility issue between the system firmware & the bootloader for the Apple Diagnostics which may result in an error such as "Cannot Load EFI/Drivers/TestSupport.efi". There are other ways to check the health of the internal drive such as using a bootable Linux USB stick....I can provide instructions if the Apple Diagnostics are unable to run or do not have any errors.
Issues with third party software is also a very common for boot issues, so try booting into Safe Mode. If this works, then you can create a bootable macOS USB installer for Catalina.
Do you have access to another working Mac from 2012 to mid-2019? If so, then you can create a bootable macOS 10.15 USB installer using the instructions linked by @leroydouglas. The other Mac can currently be running any version of macOS. You can use the information in the following article to confirm the other Mac is compatible with Catalina since the models I listed are just generalizations:
https://eshop.macsales.com/guides/Mac_OS_X_Compatibility