Here is what the Mishnah says about the goats on Yom Kippur:
https://www.sefaria.org/Mishnah_Yoma.4?lang=bi
[The High Priest] would come to the goat for Azazel and place his two hands on it, and confess. And this is what he would say: "Please God, we, Your people the House of Israel, have committed wrongdoing, transgressed, and sinned before You. Please God, please forgive the wrongdoing, transgressions and sins that we, Your people the House of Israel, have committed, transgressed, and sinned before You. As it is written in the Torah of Moses Your servant (
Leviticus 16:30), 'On this day, you will be forgiven and cleansed from all your sins—before Hashem you will be cleansed.'" Then, the priests and the people standing in the courtyard, when they heard the explicit Name from the mouth of the High Priest, would bend their knees, bow down and fall on their faces, and they would say, "Blessed be the Honored Name of His Sovereignty forever."
[The High Priest] would come to the goat for Azazel and place his two hands on it, and confess. And this is what he would say: "Please God, we, Your people the House of Israel, have committed wrongdoing, transgressed, and sinned before You. Please God, please forgive the wrongdoing, transgressions and sins that we, Your people the House of Israel, have committed, transgressed, and sinned before You. As it is written in the Torah of Moses Your servant (
Leviticus 16:30), 'On this day, you will be forgiven and cleansed from all your sins—before Hashem you will be cleansed.'" Then, the priests and the people standing in the courtyard, when they heard the explicit Name from the mouth of the High Priest, would bend their knees, bow down and fall on their faces, and they would say, "Blessed be the Honored Name of His Sovereignty forever."
They made a special ramp for him [who led the goat out], because of the Babylonians who used to pull at his hair, and say to him, Take [our sins] and go quickly, take [our sins] and go quickly. The leading citizens of Jerusalem would accompany him to the first booth. There were ten booths from Jerusalem to Tzuk [the cliff to which the goat was taken], a distance of ninety
ris [2/15 of a
mil], seven and a half
ris per
mil [two thousand cubits, for a total distance of twelve
milin].
At every booth, they would say to him, Here is food and water. And they would accompany him from one booth to the next, except for the last one, since the escort would not go with him all the way to the cliff, but rather, he would watch his actions from a distance.
What did he do [when he reached the cliff]? He divided the thread of the crimson wool, tied half to the rock, and tied the other half between its horns, and he pushed it from behind. It went rolling down, and before it reached half-way downhill, it was dashed to pieces. He returned and sat in the last booth until it became dark. And at what point did his garments become impure? From the moment he left the walls of Jerusalem. Rabbi Shimon says: from the moment he pushed it off the cliff.