It’s vital to note that Job advocated for his friends while still in the ash heap; blessing follows faith.
It’s interesting that Job’s path to blessing involved advocacy. An advocate is one who pleads another’s cause, speaking to their advantage. “And the Lord restored Job’s losses when he prayed for his friends” (Job 42:10). A glorious example of advocacy is recorded in John 17. Who are these friends of whom Christ speaks to His Father, those who “have kept Your word” (v 6), whom He desires to have “with Me where I am” (v 24)? Why, they’re the very ones about to forsake Him, even deny Him with oaths and curses! If you find it hard to pray for those “friends” who have misjudged or spoken ill of you, remember that Job’s restoration resulted “when he prayed for his friends.” And Job’s losses were restored when he acted the advocate for them. In fact, the words “restored Job’s losses” are literally translated, “turned the captivity of Job.” It was his personal exodus, being delivered from Satan’s grip, and having restored to him what had been taken away. Like Israel freed from their bondage and marching forth with the treasures of Egypt, full payment for their years of slavery, we read here, “Indeed the Lord gave Job twice as much as he had before” (Job 42:10). Some modern scholars feel this twice-blest ending spoils the whole plot. Wasn’t the point that we shouldn’t assume that wicked people suffer (as Job’s friends asserted) or that righteous people always live the life of good fortune? And here we stand at a fork in the road. As Job’s end or, rather, “the end of the Lord” (Jas 5:11) indicates, great blessing usually follows persevering faith and loyalty to the Lord, as seen here. But great trials also, when we are “exercised” by them, lead finally to their own special blessings—“the peaceable fruit of righteousness” (Heb 12:11, KJV).