Then he showed me the high priest Joshua standing before the angel of the Lord, and Satan standing at his right hand to accuse him.
References for Zechariah 3:1
And the Lord said to Satan, "The Lord rebuke you, O Satan! The Lord who has chosen Jerusalem rebuke you! Is not this man a brand plucked from the fire?"
References for Zechariah 3:2
Now Joshua was dressed with filthy clothes as he stood before the angel.
The angel said to those who were standing before him, "Take off his filthy clothes." And to him he said, "See, I have taken your guilt away from you, and I will clothe you with festal apparel."
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 the apparel; and the angel of the Lord was standing by.
Then the angel of the Lord assured Joshua, saying
"Thus says the Lord of hosts: If you will walk in my ways and keep my requirements, then you shall rule my house and have charge of my courts, and I will give you the right of access among those who are standing here.
Now listen, Joshua, high priest, you and your colleagues who sit before you! For they are an omen of things to come: I am going to bring my servant the Branch.
For on the stone that I have set before Joshua, on a single stone with seven facets, I will engrave its inscription, says the Lord of hosts, and I will remove the guilt of this land in a single day.
On that day, says the Lord of hosts, you shall invite each other to come under your vine and fig tree."