Abdullah bin Amr bin As reported,

The Messenger of Allah ﷺ was informed that I had said, "By Allah, I will fast every day and stand in prayer every night for as long as I live."The Messenger of Allah ﷺ said to him, "Are you the one who says, 'By Allah, I will fast every day and stand in prayer every night for as long as I live'?"I said, "I did say that."He said, "You are not able to do that. So fast and break your fast, stand in prayer and sleep, and fast three days of each month, for a good deed is rewarded tenfold, and that is like fasting an entire lifetime."I said, "Messenger of Allah, I am able to do better than that."He said, "Then fast one day and break your fast for two."I said, "I am able to do better than that."He said, "Then fast one day and break your fast the next. That is the fast of Dawud, and it is the most balanced form of fasting."I said, "Messenger of Allah, I am able to do better than that."He said, "There is nothing better than that."

Bukhari 3418

Sahih

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

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

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

البخاري 3418صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Hadiths of the prophets
Chapter
Saying of Allah the Exalted, "And We gave Dawud the Zabur"
Numbering
Darussalam 3418
Bukhari 3418