Reformatted Hard Drive & Transferring Over User Data and Apps
Caution: You don't really want to do a full restore, because the backup may contain whatever "totally messed up [your] Mac."  Instead, if it were me, I would install the O.S. from the net or from media that you are sure is uncorrupted, then restore as many apps as possible from the App store or where ever else they came from.  Finally, restore the user account(s) one at a time and test things.  If you find problems in a user account, delete it, create a new account with the Prefs app, and then bring in data and documents a few at a time.