I have tried twice and the process just stops halfway through. I need to format the drive as I am selling that Mac. Any suggestions would be greatly appreciated.
Have you tried creating a bootable USB installer of the OS you are trying to re-install? You boot to the installer, launch Disk Utility, select View->Show All Devices, select the top physical device listed and erase and then install the OS. If your computer has a T2 chip you will need to make sure to enable the option to boot from external drive in the security option in Recovery Mode. Also, make sure to logout of iCloud before you erase and install.
You can use a USB flash drive or other secondary volume as a startup disk from which to install the Mac operating system. These steps are primarily for system administrators and other experienced users.