I think two important parts of being able to create a meal are:
1/ having a pantry with the basic staples on hand that are used frequently by your family.
Think about the basics like baking soda, baking powder, flour, butter, herbs and spices, canned foods like tomatoes and beans. Some ingredients like baking powder can be difficult to substitute. Evaluate what kinds of foods your family enjoys (baked goods, Mexican, Italian, comfort foods, spicy or mild, soups, etc) and then consider what fundamental ingredients are the ones you use often. Stock those fundamental ingredients, in various ways. For example, if you find yourself frequently using milk in recipes, consider keeping dry milk or canned evaporated milk on hand, which can be substituted for fresh milk, and you won't run out. Find a way to organize your kitchen so that you know where your baking supplies are, the canned goods, the spices, and the dry goods like rice, pasta, oats, flour and sugar. Ask yourself what you have run out of recently. Is there a way to stock those ingredients in a different form?
2/ Being flexible.
So you don't have an ingredient. Instead of running to the store, is there a substitute? It can be an established substitute, or it can just be something you see in your kitchen. No potatoes? No problem. Do you have rice? Or bread you can toast? Or a box of pasta? Or what happens if the recipe calls for potatoes and there's not a single starch or carb in your house that night. Ok. Is there another vegetable? Be bold. Don't make yourself a hostage to a recipe. Learn a few basic swaps. If you don't have a can of cream soup, make a quick roux with oil or butter and flour (equal parts), and then stir in milk. Cook it till it's thickened, and season with salt and pepper. 10 minutes. You have soup. Or if you're making a recipe and don't have an ingredient at all, just leave it out. You can type what food you have into google and recipes will come up when you hit "search". Or there's a website called LoveFoodHateWaste where you can enter the foods you have and it will help you come up with something.
That's what works for me.