Prophet Muhammad (PBUH) was assigned as a prophet by God. Their duty, as a prophet, is to teach us His religion. Since prophets live among people, others matter outside the religion are also brought to him and he can say or take certain actions on this but it is his personal opinion.
Please consider the following incident, when after arriving in Medina, the Prophet (peace and blessings be upon him) passed by some people who were fecundating some date palms, so he asked them what they were doing. When they told him, he said,
“I don’t think that will provide any benefit,”
or in another narration, “It would be better if you didn’t do that.”
So they refrained from doing it, and that year the crop was not as good. They mentioned it to him (peace and blessings be upon him), and he replied:
“I am only a human: if I command you to do something in your religion,
then take it; but if I tell you to do something based on personal
opinion, then [realize] that I am only human,” and in another
narration, “Yet if I inform you of something from Allah, then do it,
for indeed I will never convey an untruth on behalf of Allah Mighty
and Majestic,” and in yet another narration, “You know better of your
So, in matters of religion, he is the best example and a muslim should follow him and he is the best role-model. In other matters, he may or may not choose to do what he did or say.