Al-Imaam al-Khattaabee - rahimahullaah - recorded in his book that one of the wise ones said:
من اشتغل بما لا يعنيه Ùاته ما يعنيه، ومن لم يستغن بما يكÙيه Ùليس ÙÙŠ الدنيا شيء يغنيه
'Whoever is busy with what does not concern him will miss what concerns him. Whoever is not satisfied with what is at his disposal nothing in this world will satisfy him.'
He also recorded with a chain back to Ibn Abbaas - radiyallaahu an'huma - that he said:
لا تتكلم بما لا يعنيك Ùإن ذلك Ùضل ولست آمن عليك الوزر. ودع الكلام ÙÙŠ كثير مما يعنيك Øتى تجد له موضعا، Ùرب متكلم ÙÙŠ غير موضعه قد عنت
''Do not speak in matters that do not concern you, that is an excess baggage, and I am not assuring you you will be safe from a retribution. Leave off talking about many matters that even concern you until you find the most appropriate context where you must speak, many people who speak where it is not necessary always make mistakes.'
Al-Uzlah: 134
Check out the last edition here.