Positive commandment · Mitzvat Aseh #174 of 613
To obey the High Court regarding all [the ordinances] they establish for Israel
לשמוע מכל בית דין הגדול שיעמדו להם לישראל
The verse · Devarim 17:11
עַל־פִּי הַתּוֹרָה אֲשֶׁר יוֹרוּךָ וְעַל־הַמִּשְׁפָּט אֲשֶׁר־יֹאמְרוּ לְךָ תַּעֲשֶׂה לֹא תָסוּר מִן־הַדָּבָר אֲשֶׁר־יַגִּידוּ לְךָ יָמִין וּשְׂמֹאל
“according to the sentence of the Tora which they shall teach thee, and according to the judgment which they shall tell thee, thou shalt do: thou shalt not deviate from the sentence which they shall tell thee, to the right hand, or to the left.”
The Rambam’s words
To obey the High Court regarding all [the ordinances] they establish for Israel, as [Deuteronomy 17:11] states: "Carry out the judgment which they render for you."
לשמוע מכל בית דין הגדול שיעמדו להם לישראל, שנאמר: "ועל המשפט אשר יאמרו לך--תעשה" (דברים יז,יא).
Why · Sefer HaChinuch #495
To listen to the voice of the court at all times
“It is from the roots of the commandment that we were commanded through this to strengthen the fulfillment of our religion.”
Who & when
“And this commandment is practiced by males and females at the time that the Great Court is in Jerusalem, as all are commanded to do that which they instruct.”
Where in the Mishneh Torah
Hilchot Rebels הלכות ממרים