Disk Utility app and computer refused to boot up

Getting straight to the chase, I decided to reset my old computer (MacBook 2016 Retina model) back to its factory settings to speed things up. Once done resetting, I erased the current drive using Disk Utility app and computer refused to boot up. I fixed that and proceeded to install Mac OS X. It failed every time and freezes up at 20% or less. Not sure what to do at this point so help would be greatly appreciated peps!