Will restoring a used Iphone 5 make it run like new again?

I was thinking of buying a used one.

No. Not if it has problems already. You need to make sure the phone isn't stolen and that it will work with the company you are signed up with. Get the MEI ID (they can get it off the phone, it's under settings, general, about) and call the company. They can check it in their database.

Most problems with used phones have nothing to do with resetting it (which would be a software issue), but rather other problems like having gotten wet, been dropped, etc. In other words, hardware problems.