Riyad as-SalihinChapter 17Hadith 832
Full Sharh — Riyad as-Salihin 832
وعن أبي هريرة رضي الله عنه عن النبي صلى الله عليه وسلم قال: "من كان يؤمن بالله واليوم الآخر، فليقل خيرًا، أو ليصمت" ((متفق عليه)). وهذا صريح أنه ينبغي أن لا يتكلم إلا إذا كان الكلام خيرًا، وهو الذي ظهرت مصلحته، ومتى شك في ظهور المصلحة، فلا يتكلم.
English Translation
Abu Hurairah (May Allah be pleased with him) reported:: The Prophet (ﷺ) said, "He who believes in Allah and the Last Day must either speak good or remain silent.".
Source
Riyad as-Salihin(رياض الصالحين)
The Book of the Prohibited actions
Hadith Number
832