A caloric deficit doesn't work long term, as over time your metabolism slows down to match the caloric intake.
"The key to long-lasting weight control is to control the main hormone responsible, which is insulin. Controlling insulin requires a change in our diet, which is composed of two factors — how high the insulin levels are after meals, and how long they persist. This boils down to two simple factors:
What we eat — which determines how high insulin spikes; and
When we eat — which determines how persistent insulin is."
The best resource for weight loss via fasting is Dr. Jason Fung
https://www.youtube.com/watch?v=7nJgHBbEgsE
https://www.dietdoctor.com/my-single-best-weight-loss-tip (link looks a bit spammy, but contains good information)