Hercules serves arch-rival Eurystheus
Hercules felt great guilt for killing his own family, which was a sin. He had considered suicide, but his cousin Theseus persuaded him against such a cowardly deed. Thus, Hercules set out for Delphi to seek redemption for his guilt. Here is where the Oracle of Delphi Pythia gave him the advice to travel and spend ten arduous years serving his cousin and bitter foe, King Eurystheus. Only after completing any duties Eurystheus assigns him will he be eligible for redemption. Hercules finally gave in when he was asked to serve his enemy, who was much less noble than him.
He doesn't know that Eurystheus and the Oracle both work for Hera. Eurystheus replaced Hercules as a strong ruler only because of Hera and he was wholly devoted to the Goddess. Together, they came up with ten exceedingly difficult tasks that Hercules would have to complete in order to fail and die; these are known as the "Labors of Hercules." Hercules became the ideal representation of the Greek concept of pathos—the experience of valiant struggle and suffering that would lead to acclaim and, in Hercules' case, immortality—through his struggles.