"Then these three men ceased answering Job, because he was righteous in his own eyes. But the anger of Elihu the son of Barachel the Buzite, of the family of Ram burned; against Job his anger burned because he justified himself before God." Job 32:1-2
The story of Job and all that happened to him at the hands of Satan is well rehearsed. If you know anything at all about him, you know that God allowed the Enemy to afflict him and his family when it was stated that Job only served God because of the protections and blessings afforded him. You also know that everything but his life was taken from him in the most horrendous and violent way.
At a particular point of discussion with his friends who came to mourn with him and support him (and later berate and blame him), he began to outline all of the many reasons (in his mind) that none of those things should have happened to him. You are encouraged to look at all of chapter 32 to get the scope of all he had to say about his own righteousness. His diatribe of challenges to his listeners to tell him of a time that he has not been and done good reaches a crescendo when he says, "Oh, that I had someone to hear me! I sign now my defense-let the Almighty answer me; let my accuser put his indictment in writing" Job 32:35.
Beloved, it can be an easy thing to become caught up in our own righteousness, particularly in the face of calamity. We somehow feel that because we do our best to do good, we should somehow be spared all discomfort. This is reflected in the classic question, "why do bad things happen to good people." There is certainly some heavy theological lifting when it comes to any answer that may be offered to such a question but one simple perspective is that when compared to God, we have no righteousness at all. The word of God tells us, "Indeed, there is not a righteous man on earth who continually does good and who never sins," Ecc 7:20.
Job seemed to have forgotten that he was the recipient of vast blessings from the Almighty and that they are His to both give and take away. He seemed to have forgotten that relatively speaking, his acts of righteousness are to the Lord, filthy rags. He seemed to have forgotten that he, if for no other reason than the sin of pride he was even then displaying, deserved nothing but death. Today, we would all be well served to have a better memory and understanding than Job did at that moment. It was easy for him to defend himself against his friends, but he would soon hear directly from God about the matter and it was not a conversation he wanted to have.