We know that the Prophet Muhammad (peace be upon him) judges what is permissible and forbidden (i.e. right and wrong) by using the revelation that Allah has sent down to him:

Duk mun sani cewa kyawun halin Manzon Allah (S.A.W.A) yana daya daga cikin manyan abubuwan da suka ciyar da musulunci gaba.
