In avenging the death of Patroclus, Achilles kills Hector during the Trojan War. When Achilles learns of Patroclus' death, he is both devastated and enraged. In Greek mythology, as recorded in Homer's 'Iliad', Patroclus was a close friend and wartime companion of Achilles. Patroclus was the son of Menoetius, grandson of Actor, King of Opus. After Patroclus is killed, Achilles sees it as his duty, right, and need to revenge Patroclus' death. So, he kills Hector.

During the fight with Troy, Patroclus had killed many Trojans and Trojan allies, including a son of Zeus, Sarpedon. While fighting, Patroclus' wits are removed by Apollo, after which Patroclus is hit with the spear of Euphorbos. Hector then kills Patroclus by stabbing him in the stomach with a spear.

In light of the events, Achilles, who had left, returns to battle with the Trojans. His sole or primary aim is avenging Patroclus' death by killing Hector, despite a warning that doing so would cost him his life. After defeating Hector and getting revenge, Achilles drags Hector's corpse by the heels behind his chariot.

More Info: en.m.wikipedia.org