If you are writing a story about organics or biological creatures/beings, they need food to survive. They either hunt, grow or manufacture food to survive. You know, the adage: I eat to live, I live to eat? The most basic and integral role of food is to sustain the protagonist(s) and supporting characters.
What motivates the protagonist(s)? What drives them to get out of bed and do the thing they have to do? Are they feeding themselves? Are they caring for their families? Are they finding food for their communities? What drives this particular society?
Even if your character is a being surviving on air or microbes in it, it is survival.
Food enables the protagonist(s) to live.
It sustains them.
Food also serves as a social glue. Does your protagonist(s) share food? Is food an important part of festivals and traditions? Does the community gather together to eat/share food? How do your characters show or demonstrate their love/care/kindness/compassion for others? Like all major and minor festivals, be it Lunar New Year or Christmas dinner or the breaking of fast during Ramadan, humans have often bonded over food and the making of food. Is food preparation a communal activity?
When I wrote Xiao Xiao & The Dragon's Pearl, a YA historical fantasy set in Qing China, I often wondered about the importance of food in the short novel. The book has recipes in it with each recipe paired with a particular chapter, like steamed peanuts when Xiao Xiao visited the temple with her mother. I often ate steamed peanuts when I visited the Kong Meng Sang (Bright Hill) Temple in Singapore as a child and the memory stayed with me for a long time. The street vendors sold street food. Steamed peanuts, redolent of spices, was one of them. I was not just accompanying my parents and grandparents to pay our respects to our ancestors. I was also happy to sample the delicious food. This social experience also generated a memory which has sustained me until now.
Food can be used to show status. Social, economic, ethnic etc - food has always been utilized by individuals or groups to convey their position in society or community. The more privileged they are, the more extravagant food or the acting of consumption becomes. Sometimes, it's more and more and MORE to show their wealth. Remember No-Face in Spirited Away?
The different types of food available or accessible to certain classes or groups in society often indicate their status as well. A wealthy merchant could have rare delicacies on their table. A scavenger from a post-apocalyptic world might scrounge for food in the refuse to make her stew for the night. A modern-day forager looks for edible mushrooms in the nearby forest.
Chinese New Year for us has always been moderately elaborate, with delicious food and delicacies. We get prawns, fish and chicken. Common fare for a Chinese New Year meal. Not so in the past when Singapore was in the 1950s and 60s. A whole chicken was a rich man's food. Families could save up just to buy a whole chicken for their Chinese New Year reunion dinner. So, food can be used to show status, the haves and have-nots.
To conclude, food has many roles in world-building and they overlap. It can serve as a tool of survival as well as binding and reinforcing societal ties and relationships, and indicating the character's status.
Now, toss 'food' in. Use 5W 1H.
Some basic questions you can ask yourself. Be creative and generate more.
Who needs the food?
Who makes/forages for the food?
What kind of food?
Where do you find the food? Is it grown/farmed or hunted or manufactured?
When do the protags/characters eat?
How is food perceived in the said society/community? Is it part of a communal/spiritual/societal whole?