Then he showed me Joshua the high priest standing before the angel of the Lord, and Satan standing at his right hand to accuse him. And the Lord said to Satan, “The Lord rebuke you, O Satan! The Lord who has chosen Jerusalem rebuke you! Is not this a brand plucked from the fire?” Now Joshua was standing before the angel, clothed with filthy garments. And the angel said to those who were standing before him, “Remove the filthy garments from him.” And to him he said, “Behold, I have taken your iniquity away from you, and I will clothe you with pure vestments.” And I said, “Let them put a clean turban on his head.” So they put a clean turban on his head and clothed him with garments. And the angel of the Lord was standing by.-Zechariah 3:1-5 (ESV)
Here is Joshua the high priest standing before God. Satan is standing at his right hand accusing him before God. Even as it is mentioned that he does in Revelations 12:10, refuring to the Devil as “The accuser of our brothers”.
The Lord rebukes Satan. On what basis? The merits of Jerusalem? Far from it. Simply of this merits alone: he has chose Jerusalem and plucked her from the fire! Not on any merits of her own, but simply because she was the chosen of the Lord.
Joshua’s filth garments (representing iniquity and sin) are then taken away and replaced with pure vestments. (Other version’s translate it rich robes, or simply a change of garments.)
So it reminded me of this: That, though, sinners we are, cover and defiled by our own sin and iniquity, we may to be imputed with the righteousness that is in Christ Jesus.
Indeed, I count everything as loss because of the surpassing worth of knowing Christ Jesus my Lord. For his sake I have suffered the loss of all things and count them as rubbish, in order that I may gain Christ and be found in him, not having a righteousness of my own that comes from the law, but that which comes through faith in Christ, the righteousness from God that depends on faith— Philippians 3:8-9 (ESV)
Though the Prophecy is of Israel it reminds us of the work and Jesus Christ accomplished on the Cross – the forgiveness and remissions of our sins; so that we also might be found in Him, not having a righteousness of our own (for all have sinned and fallen short of the glory of God), but that which gift from God that depends on faith.
For by grace you have been saved through faith. And this is not your own doing; it is the gift of God, not a result of works, so that no one may boast. For we are his workmanship, created in Christ Jesus for good works, which God prepared beforehand, that we should walk in them. Ephesians 2:8-10 (ESV)