Abdullah bin Amr bin As reported,

The Messenger of Allah ﷺ was informed that I had said, "By Allah, I will fast every day and pray every night for as long as I live."He asked me, "Did you say that?"I replied, "I did say it, may my father and mother be ransomed for you."He said, "You are not capable of that. So fast and break your fast, pray and sleep, and fast three days each month, for a good deed is rewarded tenfold, and that is equivalent to fasting the entire year."I said, "I am able to do more than that."He said, "Then fast one day and break your fast for two days."I said, "I am able to do more than that."He said, "Then fast one day and break your fast the next. That is the fast of Dawud عليه السلام, and it is the best of fasts."I said, "I am able to do more than that."The Prophet ﷺ replied, "There is nothing better than that."

Bukhari 1976

Sahih

حدثنا أبو اليمان أخبرنا شعيب عن الزهري قال أخبرني سعيد بن المسيب وأبو سلمة بن عبد الرحمن أن

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

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

البخاري 1976صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Fasting
Chapter
Fasting perpetually
Numbering
Darussalam 1976
Bukhari 1976