At the start of the last pandemic I happened to have a huge bag of flour and a single packet of yeast and wound up living off homemade bread with a yeast culture I kept alive for a while. This is a pretty good plan for having a stockpile of food around for such an emergency, with dried rice, beans, and pasta being other good options, along with all manner of canned goods.
The good news from the experiences of the last pandemic is that although supply chains may be disrupted there will always be plenty of food. It may be necessary to drive around in tanks to crush the zombies on the road, but we’ll still have Door Dash via tank, because we aren’t savages.
Still, it’s fun to consider what one would do to survive if all one had was an apartment or possibly a suburban lawn to get food off of. For basic calories there’s a clear winner: potatoes. Potatoes are the uber crop, able to be grown trivially and producing mass amounts of calories. They aren’t terribly nutritious, but they’ll keep you alive for a long time.
If things go long enough you’ll need a source of protein. We humans can eat practically any animal, but most of them have issues which make their domestication problematic. There are some animals which can be raised trivially under just the right conditions, for example sometimes you can build an artificial berm in the ocean and simply pick up oysters from it as they grow naturally, but for the most part the standard animals raised for meat are well the best in terms of ease of raising and yield of meat. Chickens are a ridiculous outlier in terms of yield but aren’t terribly conducive to keeping indoors. Crickets are another huge outlier in productivity and in principle can be ranched indoors but the equipment for that isn’t terribly common.
For ease of raising them indoors with occasionally letting them outside to graze there’s a clear winner: guinea pigs. The biggest problem would be people being able to bring themselves to slaughter them. Rabbits are close behind with similar slaughtering issues. Other reasonably easy animals which are bigger include goats and pigs. You’d be basically raising a petting zoo for food, which is good for having cute animals around but bad for getting attached to them.
Don't forget the plant proteins available! Soybeans (tofu) and more! (beans also have protein). :)
𝚆𝚑𝚢 𝚒𝚗 𝚝𝚑𝚎 𝚠𝚘𝚛𝚕𝚍 𝚠𝚘𝚞𝚕𝚍 𝚢𝚘𝚞 𝙴𝚅𝙴𝚁 𝚜𝚞𝚋𝚖𝚒𝚝 𝚝𝚘 𝚊 𝚋𝚞𝚕𝚕𝚜𝚑𝚒𝚝 𝚕𝚘𝚌𝚔𝚍𝚘𝚠𝚗 𝚊𝚐𝚊𝚒𝚗. 𝙹𝚄𝚂𝚃 𝚂𝙰𝚈 𝙽𝙾. 𝚃𝚑𝚊𝚝 𝚠𝚊𝚜 𝚊𝚕𝚕 𝚊 𝚝𝚘𝚝𝚊𝚕 𝚠𝚊𝚜𝚝𝚎 𝚊𝚗𝚍 𝚓𝚞𝚜𝚝 𝚖𝚊𝚍𝚎 𝚝𝚑𝚎 𝚖𝚘𝚛𝚘𝚗𝚜 𝚑𝚊𝚟𝚎 𝚖𝚘𝚛𝚎 𝚌𝚘𝚗𝚝𝚛𝚘𝚕. 𝙶𝚘 𝚑𝚒𝚐𝚑𝚎𝚛 𝚗𝚘𝚝 𝚕𝚘𝚠𝚎𝚛. 𝚃𝚑𝚊𝚝 𝚋𝚎𝚒𝚗𝚐 𝚜𝚊𝚒𝚍, 𝚍𝚛𝚒𝚎𝚍 𝚋𝚎𝚎𝚏 𝚒𝚜 𝚝𝚑𝚎 𝚠𝚊𝚢.