Here's what happened:
* Bellatrix Lestrange had managed to open a secret entrance to the Malfoy Manor.
* Harry Potter, Ron Weasley, and Hermione Granger had infiltrated the manor in an attempt to rescue Harry's elf, Dobby.
* As Harry, Ron, and Hermione attempted to escape, Bellatrix threw a knife at Harry but Dobby, in a moment of heroic self-sacrifice, jumped in front of Harry to protect him.
* The knife pierced Dobby's chest, and he died moments later in Harry's arms.
Dobby's death was a powerful moment in the story, demonstrating his unwavering loyalty and selflessness. It also highlighted the tragic consequences of the war and the sacrifices that had to be made.