“Hashem your G-d will appoint for you a prophet from your brothers like me; to him you must listen!” (Devarim 18:15)
It is a positive commandment to listen to the voice of each one of the prophets in all that he commands us, and even if he would command us to do something which is contrary to one of the commandments, or even to many of the commandments, if he is only telling us to do this temporarily, we must listen to him. The exception to this is if he tells us to worship idols. This is because one who is verily a true prophet is someone all of whose intentions are for good, and everything that he does is to strengthen the religion and to make people believe in Hashem. About this it says “Hashem your G-d will appoint for you a prophet from your brothers like me; to him you must listen!”
Amongst the roots of this commandment are that the pinnacle of levels that a person can reach is the achievement of prophesy, and a person in this world cannot have a true knowledge of anything in any way similar to the level of knowledge attained through prophesy, which is a knowledge which has no doubts as it comes from the spring of truth. Very few members of the human race merit to reach this level and mount up to it for it is at the top of an enormous ladder which has its feet on the ground and its top reaches to the heavens and only one in tens of thousands of people can reach it, and even then it is only if the generation in which he lives is fit to have someone who attains prophesy in it. For this reason the Torah commanded us that if a member of our generation reaches this high level and is well-known to us in his character and the correctness of his actions, that we should believe the prophet and listen to him whatever he says, for he knows the true way and will guide us along it. We must not lift up our souls to rebel against his word and argue with him, for dispute with him in any form is a complete error, and shows a lack of understanding of the truth.
This commandment applies to men and to women at any time that a true prophet is found amongst us, and one who transgresses this and does not listen to the prophet, deserves death at the hands of heaven.