Read the beginning of Book 22. Among other things, Hector, finding himself outside the walls of Troy, debates with himself whether to stand up to Achilles or to flee. It seems pretty clear that he already knows he's likely to lose a fight, but he doesn't want to live on branded a coward.
He also now realizes that he should've withdrawn into Troy much earlier. Although this story isn't Hector's tragedy, I think that he has some tragic elements as well, and this fatal overconfidence is his biggest flaw. He hadn't realized that, just as the scales suddenly tipped in his favor, they could as quickly be reversed.
I think that the whole sequence is one of the great soliloquies in the Iliad. In general, heroes aren't given to self-doubt, and the epic idiom doesn't really lend itself to complex monologs, so this struck me as a real tour de force.