The Messenger of Allah ﷺ said to me: The fast most liked by Allah is the one observed by Dawud (David), and the prayer dearer to Allah is the one offered by Dawud (David): he would sleep half the night, and stand (in prayer) one-third of it, and sleep one-sixth of it. He would go without fasting one day, and fast the other day. (Using translation from Abū Dāʾūd 2448)
قَالَ رَسُولُ اللهِ ﷺ أَحَبُّ الصِّيَامِ إِلَى اللهِ صِيَامُ دَاوُدَ وَأَحَبُّ الصَّلَاةِ إِلَى اللهِ صَلَاةُ دَاوُدَ كَانَ يَنَامُ نِصْفَهُ وَيَقُومُ ثُلُثَهُ وَيَنَامُ سُدُسَهُ وَكَانَ يَصُومُ يَوْمًا وَيُفْطِرُ يَوْمًا