وَعَن أَنَسِ بْنِ مَالِكٍ أَنَّ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ كَانَ يَقُولُ: لَا تُشَدِّدُوا عَلَى أَنْفُسِكُمْ فَيُشَدِّدَ اللَّهُ عَلَيْكُمْ فَإِنَّ قَوْمًا شَدَّدُوا عَلَى أَنْفُسِهِمْ فَشَدَّدَ اللَّهُ عَلَيْهِمْ فَتِلْكَ بَقَايَاهُمْ فِي الصَّوَامِعِ والديار (رَهْبَانِيَّة ابتدعوها مَا كتبناها عَلَيْهِم) رَوَاهُ أَبُو دَاوُد
Anas declared that God’s messenger used to say, “Do not impose austerities on yourselves and so have God imposing austerities on you; for people have imposed austerities on themselves and God has imposed austerities on them. Their survivors are to be found in cells and monasteries.” [Then he quoted], “Monasticism, they invented it; we did not prescribe it for them.” Abu Dawud transmitted it.
Related hadith on this topic