Should you give the sick whatever they want in terms of food? There are two hadiths in this regard, both of which are reported by Imam Ibn Majah in his Sunan, in the Chapters Regarding Funerals and Medicine.
Ibn ‘Abbas reported that the Prophet (ﷺ) visited a (sick) man and asked: “What do you desire?” The man replied: “I desire some wheat bread.” The Prophet (ﷺ) said: “Whoever has some wheat bread, then send it to his brother.” Then the Prophet (ﷺ) said: “If a sick person among you desires something then feed it to him.” [Hadith 1439 and 3440]
Anas b. Malik reported that the Prophet (ﷺ) visited a sick person and said: “What do you desire? Do you desire some Ka’ka (a type of persian bread)?” The [man] said “yes” so the Prophet (ﷺ) requested it for him. [Hadith 1440 and 3441]
Before anyone ill starts making requests (!), both these hadiths have been graded weak by Sh. al-Albani; Imam al-Busairi and Sh. Zubair Ali Zae said likewise about their isnads. It is therefore not permissible to attribute these words to the Prophet (ﷺ) without indicating their weakness.
Nevertheless, several scholars have explained some of the benefits and wisdom in giving the sick what they desire, such as:
There is no harm if a sick person eats something they desire if it is a little amount, it strengthens him and helps him recover – as long as that food does not harm him in general.
A person who finds strength from eating what he desired, or he recovers, should put his trust and reliance (tawakkul) on Allah alone for He is the one who cures (not the food) and He gives and takes life.
It may be that a sick person eats something which he desires and it harms him a little, but overall it benefits him.
A doctor should take into consideration what a sick person desires as it may be indicative to the method of recovery.
Some doctors in the past viewed the strength of a person’s desire as a good sign. As such, Ibn Sina said: “A sick person who desires something is more beloved to me than a healthy person who does not!”
Perhaps it is for this reason that when a doctor advised Ibn Taymiyyah when he was feeling unwell, that the long time he was spending in seeking and teaching knowledge was contributing to his illness, Ibn Taymiyyah replied by saying: “Is it not the case that when a person’s nature finds joy, happiness and strength, this repels sickness?” The doctor replied “Yes of course!” So Ibn Taymiyyah said: “Well then my soul finds joy in knowledge, and my nature is strengthened by it and so I feel comfort!” The doctor said defeatedly: “This is beyond our treatment!” [This story was mentioned by Ibn Qayyim in Rawdah]
See Injaz al-Hajjah by Sh. Janbaz and the commentary to Ibn Majah by al-Sindi for further benefit.