"Allah is sufficient for us, and He is the best disposer of affairs" [Aal Imran 3:173]. Ibrahim said it when he was thrown into the fire, and Muhammad ﷺ said it when they said, "Indeed, the people have gathered against you, so fear them. But it only increased them in faith, and they said, 'Allah is sufficient for us, and He is the best disposer of affairs.'" [Aal Imran 3:173].
{حسبنا الله ونعم الوكيل} قالها إبراهيم عليه السلام حين ألقي في النار، وقالها محمد ﷺ حين قالوا: {إن الناس قد جمعوا لكم فأخشوهم فزادهم إيمنا وقالوا حسبنا الله ونعم الوكيل}
Bukhari narrated it in the chapters on the prophets (4563) from Ahmad bin Yunus, and I think he said, Abu Bakr told us, from Abu Husayn, from Abu Duha, from Ibn Abbas, who mentioned it.In another wording of his, also from Ibn Abbas, "The last words of Ibrahim as he was thrown into the fire were, 'Allah is sufficient for me, and He is the best guardian.'" Bukhari narrated it in the chapters on the prophets (6564) from Malik bin Ismail, Israel told us, from Abu Husayn, from Abu Duha, from Ibn Abbas, who mentioned it.As for what was narrated from Abu Hurairah, who said, the Messenger of Allah ﷺ said, "When Ibrahim was thrown into the fire, he said, 'O Allah, You alone are in the heaven, and I alone on the earth worship You,'" this is daif. Uthman Darimi narrated it in Radd Ali Jahmiya (75), and Abu Naeem in al-Hilya (1/19), and Khatib in his Tarikh (10/346), all of them by way of Abu Hisham Muhammad bin Yazid Rafii, Ishaq bin Sulayman Razi Abu Yahya told us, from Abu Jafar Razi, from Asim bin Bahdala, from Abu Salih, from Abu Hurairah, who mentioned it. And Muhammad bin Yazid Rafii is daif.