When he and Harry attempt to complete the final task, they work together, Cedric even allowing Harry to take the glory for himself.
His role in the series ends in a significant way that marks a turning point for Harry and the series as a whole.
When Cedric is murdered, the death marks Harry’s transition into the series’ more mature second half as he experiences the more serious stakes at play.
In Goblet of Fire, another Hufflepuff character takes a more prominent role for the Triwizard Tournament when Cedric Diggory (played by Robert Pattinson in the film) is part of the competition alongside Harry Potter, Fleur Delacour and Viktor Krum.