Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:49:6

O you who have believed, if there comes to you a disobedient one with information, investigate, lest you harm a people out of ignorance and become, over what you have done, regretful.  

The following was revealed regarding al-Walīd b. ‘Uqba whom the Prophet had sent to the Banū al-Mustaliq in order to ascertain ˹their loyalty to Islam˺. He already feared them on account of an old feud between him and them from the time of pagandom ˹before Islam˺, and so ˹upon seeing them come out to him˺ he returned and claimed that they had refused to give the voluntary alms and intended to kill him. And just as the Prophet (s) was making plans to raid them, they came to him to disavow what he ˹al-Walīd˺ had said about them: O you who believe, if a reprobate should come to you with some tiding, some piece of information, verify ˹it˺, ˹ascertain˺ his truthfulness from his mendacity (fa-tabayyanū: a variant reading has fa-tathabbatū, from al-thabāt, ‘to ascertain’), lest you injure a folk (an tusībū qawman, an object denoting reason), that is to say, for fear of this ˹happening˺, out of ignorance (bi-jahālatin is a circumstantial qualifier referring to the subject ˹of the verb˺), that is to say while you are ignorant; and then become remorseful of what you have perpetrated, erroneously against that folk. After they had returned to their homelands, the Prophet (s) sent Khālid ˹b. al-Walīd˺ to them, who observed only obedience and goodness in them and ˹later˺ informed the Prophet of this.
القرآن:٤٩:٦

يَا أَيُّهَا الَّذِينَ آمَنُوا إِنْ جَاءَكُمْ فَاسِقٌ بِنَبَإٍ فَتَبَيَّنُوا أَنْ تُصِيبُوا قَوْمًا بِجَهَالَةٍ فَتُصْبِحُوا عَلَىٰ مَا فَعَلْتُمْ نَادِمِينَ  

{يا أيها الذين آمنوا إن جاءكم فاسق بنبأ} خبر {فتبينوا} صدقه من كذبه، وفي قراءة فتثبتوا من الثبات {أن تصيبوا قوما} مفعول له، أي خشية ذلك {بجهالة} حال من الفاعل، أي جاهلين {فتصبحوا} تصيروا {على ما فعلتم} من الخطأ بالقوم {نادمين} وأرسل ﷺ إليهم بعد عودهم إلى بلادهم خالدا فلم يرَ فيهم إلا الطاعة والخير فأخبر النبي بذلك.