Abdullah bin Amr bin As reported,

The Messenger of Allah ﷺ said to me, "Abdullah bin Amr, you fast continuously and stand in prayer all night. If you keep doing that, your eyes will become sunken and your body worn out. There is no fasting for one who fasts forever. Fasting three days of each month is equivalent to fasting the entire month."I said, "I am able to do more than that."He said, "Then fast as Dawud fasted. He would fast one day and break his fast the next, and he would not flee when he met the enemy."

Muslim 2736

Sahih

و حدثنا عبيد الله بن معاذ حدثني أبي حدثنا شعبة عن حبيب سمع أبا العباس سمع

عبد الله بن عمرو رضي الله عنهما قال

قال لي رسول الله ﷺ يا عبد الله بن عمرو إنك لتصوم الدهر وتقوم الليل وإنك إذا فعلت ذلك هجمت له العين ونهكت لا صام من صام الأبد صوم ثلاثة أيام من الشهر صوم الشهر كله قلت فإني أطيق أكثر من ذلك قال فصم صوم داود كان يصوم يوما ويفطر يوما ولا يفر إذا لاقى

مسلم 2736صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Fasting
Chapter
Prohibition of perpetual fasting for one who is harmed by it or neglects a right because of it or does not break fast on the two Eids and Tashriq, and explanation of the virtue of fasting one day and breaking fast one day
Numbering
Darussalam 2736
Muslim 2736