Matthew 17:21 NKJV 21 However, this kind does not go out except by prayer and fasting
That was Jesus’s reply to the man whose son was demon-possessed but the disciples could not cast out that demon. For that demon to be cast out, prayer needed to be coupled with fasting. There are occasions when prayer alone is not enough.
In Matthew 6:16-17, when Jesus taught His disciples about fasting, “When you fast, do not look somber as the hypocrites do, for they disfigure their faces to show others they are fasting. Truly I tell you, they have received their reward in full. But when you fast, put oil on your head and wash your face.”
Twice, Jesus said “when you fast”, not “if you fast”. Fasting is expected of His followers.
There are many guidelines about fasting. A person with a medical condition needs clearance from doctors. Here is a link to get more information about fasting: