I regularly cook for someone else on my fast days.
For me, the key part was building a habit of only eating what I've planned for the day, and never eating between meals. I had deliberately cultivated this habit before starting fasting; when I started keto, I planned for three meals a day, no snacking between meals, no nibbling while I cooked, etc. I thought it'd be a struggle ... but, to my surprise, ignoring candy at the store, or food I was cooking, or whatever, quickly became as easy as brushing my teeth.
All of those habits carried over when I started alternate-day fasting. There might be food around - I might be the person cooking it! - but I don't think about eating it. It's not a question of resisting temptation. I'm just not tempted in the first place. I'm in the habit of not eating on fast days and only eating my planned foods at mealtimes, and I don't have to think about it.
I wouldn't have believed this myself before I tried it. But **habit is more important than willpower.**
BTW, the book that convinced me that changing my habits was they key to getting in shape was Good Habits, Bad Habits. If you're skeptical about the idea that habits affect our behavior more than willpower, check it out!
Check out:
The Four Tendencies by Gretchen Rubin
Good Habits, Bad Habits by Wendy Wood
getsupporti.com the accountability partner app that finds you mutual support buddies