What is the exact model of your Mac? If you don't know, then you can get this information by entering the system serial number on the check coverage page here (please don't post the serial number on the forum since it is considered personal information):
View Coverage - AppleCare & Warranty
Following @John Galt's advice, you will want to try booting into Internet Recovery Mode using Command + Option + R to access the most recent online macOS installer compatible with your Mac. Hopefully it will be macOS High Sierra, but then that comes with its own issues these days. If that is the case, then you may need to try Fix #3 in the following article (it should work for other versions of macOS as well if you get the recovery server could not be contacted error):
https://mrmacintosh.com/how-to-fix-the-recovery-server-could-not-be-contacted-error-high-sierra-recovery-is-still-online-but-broken/
You will want to erase the whole physical drive as GUID partition and MacOS Extended (Journaled). Within Disk Utility you may need to click "View" and select "Show All Devices" before the physical drives appear on the left pane of Disk Utility.
If you are unfortunate enough to only be able to access the online macOS Lion installer (or any version of macOS up to & including 10.10 Yosemite), then you should instead partition & format the physical drive using the information in the following article:
https://eshop.macsales.com/tech_center/formatting/Mac_Formatting_6-10_R3.pdf
If we know the exact model of your Mac, then we can possibly provide other options for reinstalling macOS.
As @John Galt mentioned, Linux Mint is a much better option for older Macs than Ubuntu. Linux Mint is based on Ubuntu, but the Linux Mint developers have made some changes which should make it perform better on the older hardware, plus they use a different Desktop Environment (aka GUI interface). The default Ubuntu installation is not made for use on older hardware with limited resources because the default Ubuntu installation is very resource intensive.
I can also understand that Linux is not for everyone since it does require the user to learn a new OS and things are drastically different. Even someone who is more computer literate & technically minded, it can take a while to become familiar with Linux so it becomes comfortable. The most difficult part of Linux is usually the initial setup, configuration, and customization to get it ready for what you want to do. Once that is done, Linux usually doesn't require anything else until it is time to upgrade to a new version of the OS.
Usually if people are resorting to Linux, then it is usually their last option before selling/recycling the computer. I'm sure one thing those online posts forgot to mention was to inform the user to plan ahead in case Linux was not for them. Those people should have suggested creating a bootable macOS USB installer while you could still boot into macOS which would have made reinstalling macOS much easier (I try to mention that whenever I suggest Linux Mint, but I may omit it if the user I'm assisting is more technical). This still may be an option if you have access to a working Mac that is compatible with an OS your Mini can use....which is why knowing the exact model is important.
Once we know the exact model of your Mac we may be able to provide more options to assist you with reinstalling macOS.