Zechariah 3 describes a high priest named Joshua standing before the Lord, and Satan standing at his right hand to oppose him. Also present was an angel, who had to be Christ because angels do not judge.
Joshua was a real man, not just a type of Christ. He was the high priest during the time of Ezra and Nehemiah. In Ezra 10:18 it appears that Joshua had married a heathen woman; at that time, the worst way a Jew could defile himself was by marrying a Gentile.
"Now Joshua was clothed with filthy garments, and stood before the angel" (Zechariah 3:3). Joshua stands before the throne in his filthy garments, and the devil is at his side, accusing him. Satan argued: "This man has broken Your law and sinned against You." The devil's accusations were correct: Joshua had sinned and now Satan claimed Joshua for himself.
Beloved, this is exactly what happens with us. Satan comes before the throne of grace to accuse us. He points at us and says, "You know all things, God, and You see the compromise in this one's life. If You are just, You must give me his soul." In Revelation 12:10, Satan is called "the accuser of our brethren” and he stands before God right now to oppose you and me — to accuse us of sin.
That is when Jesus, our Advocate, steps up and says, "It is true, Father. He has failed but there is faith in his heart — faith in the power of My blood. I have paid for every sin he has or ever will commit." Jesus then turns to those standing by, "Take his filthy garments and put My robe of righteousness upon his shoulders."
Jesus said to Satan, "The Lord rebuke thee, O Satan . . . Is not this a brand plucked out of the fire?" (Zechariah 3: 2). What a picture! The devil was forced to leave with a sound rebuke and Joshua walked away with a pardon, a new garment and a crown of righteousness on his head.
"If any man sin, we have an advocate with the Father, Jesus Christ the righteous" (1 John 2:1). Jesus has been in glory for these 2,000 years praying for us and He is still praying for us.