It is narrated from Sayyiduna Ali (may Allah be pleased with him) that he said: "The Prophet (peace and blessings be upon him) said to me: 'O Ali, there will indeed soon be a trial (fitnah), and you will dispute with your people.' I said: 'O Messenger of Allah, then what do you command me?' He (peace and blessings be upon him) said: 'Judge according to the Book of Allah,' or he (peace and blessings be upon him) said: 'Follow the Book of Allah.'"
Imam al-Tabarani (may Allah have mercy on him) said: "Only Ata narrated this hadith from Sufyan, and Ubayd is alone in narrating it."
Hadith Referenceالمعجم الأوسط / باب الألف / 1132
Hadith Takhrij«أخرجه الطبراني فى «الصغير» برقم: 978»