How do you beat David in The Last of Us Part I?

Quick answer: Stay hidden, sneak up behind David and stab him with your knife when he is not looking. Throw a brick to stun him when he gets careful, and repeat until a cutscene ends the fight.
Show walkthrough (story spoilers)
How the fight works
David hunts Ellie through the burning restaurant, and he kills you fast if he catches you in the open. This is a stealth fight, not a gunfight. Use Listen Mode to track him and stay behind cover.
First stabs
Sneak up behind him while he walks and talks, and stab him with your knife. Each successful hit moves the fight on. Watch your step, because noise gives your position away.
When he gets careful
Later David crouches and moves between cover, which makes him harder to spot. Pick up a brick, sneak close and throw it to stun him. Then run in and stab him while he is dazed.
The ending
After the last hit, a cutscene finishes the fight and the story switches back to Joel. See the Lakeside Resort walkthrough for the rest of the chapter.
