Doing it somewhat regularly makes it easier. Then sticking to good 16-8 I.F. in between also helps future fasts.
The first time I did a full day I also doubted my ability to do any longer, but nowadays I can do 4-7 days without much issue. Usually I set myself a goal I know I can achieve with a little bit of willpower (in my case 3 days) and then listen to my body. Usually after day 2 or 3 it’s easy sailing and I just keep going.
Doing longer fasts electrolytes are very important and breaking the fast should be done gradually with easily digestible food.