Herod died the way he lived: in agony, surrounded by plots, and trying to control what happened after he was gone. His body was rotting while he was still inside it.
According to Josephus in Antiquities XVII, the disease that killed Herod was horrific. His intestines were ulcerated. His feet swelled with fluid. His genitals were gangrenous and bred worms. His breathing came in convulsions. Every physician in the kingdom was summoned, and none could help. He crossed the Jordan to the hot springs at Callirrhoe for treatment. When attendants lowered him into a bath of warm oil, he fainted and nearly died on the spot.
Back at Jericho, Herod devised one final monstrous plan. He ordered the most distinguished men from every village in Judea locked inside the hippodrome. He told his sister Salome and her husband Alexas to have them all killed the moment he died, so that every family in the nation would be mourning, even if they were mourning the wrong person. He refused to die ungrieved.
His will changed three times in his final days. First he named Antipater heir, then Antipas, and finally Archelaus. Antipater, still imprisoned for attempting to poison Herod, made one last bid for the throne by trying to bribe his jailer. When Herod learned of it, he summoned enough strength to order his son's execution. Five days later, Herod himself was dead, around 4 BCE, at roughly seventy years of age.
Salome and Alexas, to their credit, released the men in the hippodrome instead of slaughtering them. Archelaus staged a lavish funeral procession from Jericho to the fortress of Herodium, where the king was buried in purple, crowned in gold, with his scepter in his hand. Then the family descended on Rome to fight over the kingdom. Augustus Caesar eventually split it three ways: Archelaus got Judea, Antipas got Galilee, and Philip got the northeast territories. The Herodian dynasty fractured exactly as its founder had feared.