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.
bayhaqi:1029And Qad > Muḥammad b. ʿAbdullāh al-Ḥāfiẓ > Abū al-ʿAbbās Muḥammad b. Yaʿqūb > Yaḥyá b. Abū Ṭālib > Abū Salamah al-Khuzāʿī > Layth > Yazīd / Ibn al-Hād > Ibn Shihāb > Saʿīd b. al-Musayyib Waʾabī Salamah > Abū Hurayrah

[Machine] I heard the Messenger of Allah ﷺ saying, "Whatever I have forbidden you from, avoid it, and whatever I have commanded you with, do as much of it as you can. Verily, those who were before you were destroyed due to excessive questioning and differing over their prophets."  

البيهقي:١٠٢٩قَالَ وَقَدْ أَخْبَرَنَا مُحَمَّدُ بْنُ عَبْدِ اللهِ الْحَافِظُ ثنا أَبُو الْعَبَّاسِ مُحَمَّدُ بْنُ يَعْقُوبَ ثنا يَحْيَى بْنُ أَبِي طَالِبٍ ثنا أَبُو سَلَمَةَ الْخُزَاعِيُّ ثنا لَيْثٌ عَنْ يَزِيدَ يَعْنِي ابْنَ الْهَادِ عَنِ ابْنِ شِهَابٍ عَنْ سَعِيدِ بْنِ الْمُسَيِّبِ وَأَبِي سَلَمَةَ عَنْ أَبِي هُرَيْرَةَ قَالَ

سَمِعْتُ رَسُولَ اللهِ ﷺ يَقُولُ مَا نَهَيْتُكُمْ عَنْهُ فَاجْتَنِبُوهُ وَمَا أَمَرْتُكُمْ بِهِ فَافْعَلُوا مِنْهُ مَا اسْتَطَعْتُمْ فَإِنَّمَا أَهْلَكَ الَّذِينَ مِنْ قَبْلِكُمْ كَثْرَةُ مَسَائِلِهِمْ وَاخْتِلَافِهِمْ عَلَى أَنْبِيَائِهِمْ  

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

See similar narrations below:

Collected by Muslim
muslim:1337bḤarmalah b. Yaḥyá al-Tujībī > Ibn Wahb > Yūnus > Ibn Shihāb > Abū Salamah b. ʿAbd al-Raḥman Wasaʿīd b. al-Musayyab

Avoid that which I forbid you to do and do that which I command you to do to the best of your capacity. Verily the people before you went to their doom because they had put too many questions to their Prophets and then disagreed with their teachings.  

مسلم:١٣٣٧bحَدَّثَنِي حَرْمَلَةُ بْنُ يَحْيَى التُّجِيبِيُّ أَخْبَرَنَا ابْنُ وَهْبٍ أَخْبَرَنِي يُونُسُ عَنِ ابْنِ شِهَابٍ أَخْبَرَنِي أَبُو سَلَمَةَ بْنُ عَبْدِ الرَّحْمَنِ وَسَعِيدُ بْنُ الْمُسَيَّبِ قَالاَ كَانَ أَبُو هُرَيْرَةَ يُحَدِّثُ

أَنَّهُ سَمِعَ رَسُولَ اللَّهِ ﷺ يَقُولُ: «مَا نَهَيْتُكُمْ عَنْهُ فَاجْتَنِبُوهُ وَمَا أَمَرْتُكُمْ بِهِ فَافْعَلُوا مِنْهُ مَا اسْتَطَعْتُمْ، فَإِنَّمَا أَهْلَكَ الَّذِينَ مِنْ قَبْلِكُمْ كَثْرَةُ مَسَائِلِهِمْ وَاخْتِلاَفُهُمْ عَلَى أَنْبِيَائِهِمْ۔»