In a sentence: Trump rolled over several times and gave Kim major concessions in return for almost nothing, but then pulled the plug when Kim tried to leverage him into a losing endgame. At least he had enough sense to quit before he made even more of a mess of things.
Hanoi was doomed to fail because Trump is lazy and refuses to do his homework. That was driven home with an excellent piece from The Daily Beast (link here) with the headline "Hanoi Summit Failed Because Trump Refuses to Prep" and the subhead of "Trump hates to prepare and likes to negotiate from the gut. The Hanoi humiliation with Kim Jong Un was the direct result."
Even Trump admits he was a lazy student in school and refused to do homework and the necessary readings. But that kind of indolence doesn't work when you're supposed to be a head of state.
Once again, Trump is his own worst enemy.