This is to supplement @P. Phillips reply in case you forgot to perform the first step of having a second admin user account, then you will need to use the instructions in this article written by a well respected forum contributor in order to create a new admin user account so you can use the instructions provided by @P. Phillips to correct the mistakes made with your earlier attempt.
Restarting Setup Assistant to create Admin user under Catalina - Apple Community
While this article's instructions are for Catalina, the procedure for Mojave is very similar. The only change to make is to the path used in the Terminal commands. The rest of the article information should be relevant for Mojave as well. Here are the commands which will work in macOS Mojave and earlier:
rm -i /Volumes/Macintosh\ HD/var/db/.AppleSetupDone
or
rm -i "/Volumes/Macintosh HD/var/db/.AppleSetupDone"
This assumes that you did not modify the drive/volume name from the macOS default of "Macintosh HD". If you did modify the drive/volume name, then you will need to properly replace the "Macintosh HD" or "Macintosh\ HD" in the path with the modified drive/volume name.
Otherwise if none of this works, then you can restore your system from a backup made before you attempted to make such a drastic system change.
You should always have frequent and regular backups of your computer and all external media (including the cloud) which contains important & unique data.
Good luck.