Fred Weasley dies during the Battle of Hogwarts in the seventh and final novel, Harry Potter and the Deathly Hallows (2007).
The scene is not depicted "on-page" at the exact moment of death. Instead, the narrative cuts away; Harry later sees Fred's body in the Great Hall among the fallen, and the family's grief—particularly George's—is portrayed in the aftermath. The loss is confirmed narratively and emotionally, making it one of the series' most devastating moments.