For a summation of the plot without much spoiling, head over to Susan Arendt's recap, but if you're a fan of the books and want more in-depth, spoiler-rich discussion of what happens in "You Win or You Die," read on, my friends!
In case that's not crystal clear, there are spoilers in here for both the rest of the TV show and the book series so please, tread carefully if you don't want to know the future events of either.
The main character in Martin's first novel A Game of Thrones is undeniably EDDARD STARK. He receives the most point-of-view chapters and the plot follows his rise and fall as the Hand of the King under his friend ROBERT BARATHEON. Ned Stark arrives in King's Landing as green in southern politics as a bent sapling, and he doesn't seem to ever get the knack of it over the few months he spends in the capital. Despite that, or perhaps because of his naiveté, the audience roots for Stark to triumph over the scheming bastards. But by the last few moments of "You Win or You Die," we see Ned Stark make so many bad decisions that even though we like him, it's not hard to blame him for naively accomplishing the latter half of the episode's title .
By my estimation, here's everything Stark should have done in the last days leading up Robert's death:
Make Allies Before You Need Them
Time seems a bit compressed in the show, but Stark is in King's Landing for at least a few months. What does he spend his time doing? Chasing the trail of former Hand JON ARRYN'S investigation into the bloodline of CERSEI'S children and falling into the exact same trap the deceased did. If Stark suspects that Arryn died because of what he knew - which the letter from LYSA ARRYN clues him into the first episode - then he should have invested more effort in trying to protect himself either with more guards or better political allies.
Instead, Stark bumbles around the city, talking to whores. It's only when it is absolutely crucial that he have manpower he trusts that Ned reaches out to LITTLEFINGER and the GOLD CLOAKS, but by that time it is too late. Ned Stark seems to think that such politicking is beneath him, and that's ultimately what gets him killed.
Don't Show Your Hand Too Early
When you're holding the best cards, don't let your opponent know it until there's no way they can respond. Stark wrongly assumed that Cersei Lannister had honor, and tells her everything he has discovered regarding the heritage of JOFFREY and the rest of her brood with JAIME. He tells her to flee the city. Why exactly does Ned think that a woman who screws her twin brother is going to do the "right thing" and leave the city?
By letting Cersei know his intentions, he forces her to act as quickly as possible. She probably bought the Gold Cloaks directly after the conversation with Ned Stark in the garden, if she hadn't already locked up JANOS SLYNT with a title and a place on the Small Council. All of which could have been avoided if Stark had kept his hand closer to his chest.
Kindness Has a Time and a Place
Learning that Robert was going to die certainly messed up Ned Stark's plans, but he still could have outfoxed the Lannisters if he let the fat King know the truth about Joffrey. Instead, Stark holds his tongue out of love for his friend, letting the King die believing he had done "this one thing right" and that his royal children were his own. This is where Ned's "honor" is frightfully inconsistent. The perfectly right thing to do would have been to tell the truth to his friend, but he decided to omit the information to ease his friend's passing.
Robert Baratheon might have been dying, but he was still the King. Who knows what he would have done from his deathbed - probably called for his wife's head - but Robert might have had enough willpower to still make it happen. We'll never know, because Ned Stark couldn't tell his friend that he failed utterly as a father, a husband, and a monarch.