Abu Ishaq relates that Sayyiduna al-Bara' bin Azib (may Allah be pleased with him) said to me: Shall I not teach you a supplication that the Messenger of Allah (peace and blessings be upon him) taught me? He said: "When you see that people have become greedy for gold and silver, then supplicate with these supplications: 'Allahumma inni as'aluka al-thabata fil-amr, wa as'aluka azimata al-rushd, wa as'aluka shukra ni'matik, wal-sabra ala bala'ik, wa husna ibadatik, wal-rida bi-qada'ik, wa as'aluka qalban saliman wa lisanan sadiqan, wa as'aluka min khayri ma ta'lam, wa a'udhu bika min sharri ma ta'lam, wa astaghfiruka lima ta'lam' (O Allah, I ask You for steadfastness in (every) matter, and I ask You for a firm resolve upon right guidance, and I ask You for gratitude for Your blessings, patience in Your trials, excellence in worshipping You, and contentment with Your decree; and I ask You for a sound heart and a truthful tongue; and I ask You for the good of what You know, and I seek refuge in You from the evil of what You know, and I seek Your forgiveness for what You know)."
Hadith Referenceالمعجم الكبير للطبراني / باب الباء / 1161