Abu Hurairah reported,

The Prophet ﷺ said, "Leave me as I have left you. Those before you were destroyed only because of their excessive questioning and their disagreements with their prophets. So when I forbid you from something, avoid it, and when I command you to do something, do as much of it as you are able."

Azami 1287

Sahih

عن أبي هريرة

عن النبي ﷺ قال: دعوني ما تركتكم إنما هلك من كان قبلكم بسؤالهم، واختلافهم على أنبيائهم، فإذا نهيتكم عن شيء فاجتنبوه، وإذا أمرتكم بأمر فأتوا منه ما استطعتم.

الأعظمي 1287صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Knowledge
Chapter
Warnings in matters of knowledge
Section
Prohibition of excessive questioning about what has not occurred and about which no revelation has been sent down
Numbering
Jami al-Kamil 1287 (2nd edition)
Azami 1287