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.” , “Monasticism, they invented it; we did not prescribe it for them.” 1 Abu Dawud transmitted it. 1 ibid, lvii, 27.
Source: sunnah.com
Other translations
Arabic
وَعَن أَنَسِ بْنِ مَالِكٍ أَنَّ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ كَانَ يَقُولُ: لَا تُشَدِّدُوا عَلَى أَنْفُسِكُمْ فَيُشَدِّدَ اللَّهُ عَلَيْكُمْ فَإِنَّ قَوْمًا شَدَّدُوا عَلَى أَنْفُسِهِمْ فَشَدَّدَ اللَّهُ عَلَيْهِمْ فَتِلْكَ بَقَايَاهُمْ فِي الصَّوَامِعِ والديار (رَهْبَانِيَّة ابتدعوها مَا كتبناها عَلَيْهِم) رَوَاهُ أَبُو دَاوُد
sunnah.com