Positive commandment · Mitzvat Aseh #172 of 613
Heed a true prophet
לשמוע מכל נביא שיהיה בכל דור ודור אם לא יוסיף ולא יגרע
The verse · Devarim 18:15
נָבִיא מִקִּרְבְּךָ מֵאַחֶיךָ כָּמֹנִי יָקִים לְךָ ה׳ אֱלֹהֶיךָ אֵלָיו תִּשְׁמָעוּן
“The Lord thy God will raise up to thee a prophet from the midst of thee, of thy brethren, like me; to him you shall hearken;”
The Rambam’s words
To listen to any prophet who will arise in any era, provided he does not add or detract [from the Torah's commandments], as [Deuteronomy 18:15] states: "You shall listen to him."
לשמוע מכל נביא שיהיה בכל דור ודור אם לא יוסיף ולא יגרע, שנאמר: "אליו, תשמעון" (דברים יח,טו).
Why · Sefer HaChinuch #516
Heed a true prophet
“It is from the roots of the commandment [that it is] since the highest level for a man is attaining prophecy, and there is nothing for a man in this world that is true knowledge of things like the true knowledge [he acquires] through prophecy; as it is knowledge that has no hesitation about it, since it comes from the Spring of truth.”
Who & when
“And this commandment is practiced by males and females at any time that a prophet is found among us.”
Where in the Mishneh Torah
Hilchot Foundations of the Torah הלכות יסודי התורה