This is going to sound strange and counterproductive, but this suggestion works when fasting (at least it has for me over the past 20 years). If you are struggling at some point in your fast and think about quitting, DON’T!!! Instead deny your flesh even more!!!
Example, if you are doing a DF fast and consider quitting than switch to a liquid only day instead, because the next day you will truly appreciate the fruits and vegetables you have been eating. 😂 If you are on a liquid only fast and consider quitting go to an absolute fast for a day. If you are on an absolute fast (or one of the above) and consider quitting add in even more prayer, bible study, and praise time during your usual meal times. You get the picture. More God focused and less me focused! More focused on God assignments than pleasures of the world. The louder your flesh screams the more you deny it and suppress it into submission!! Remind yourself what you are ALLOWING yourself to do/eat in this season for spiritual growth instead of grumbling about what you can’t do/eat, so that you are keeping the right mindset and being obedient to the word of God.
This is only a suggestion from my personal experience, but it may not work for you so please, please, please be prayerful and seek the Lord for strength and wisdom on how to continue if and when you struggle as we all have at some point in this faith walk.