Having a well-stocked pantry is always a good idea, whether you’re looking to throw together pasta with anchovies when there’s nothing in the fridge, or you want to avoid going grocery shopping when the weather is vile.

It’s also true that a well-stocked pantry can provide a sense of safety and control when the news is frightful and the future uncertain. Not only can shelves filled with bags of rice, cans of beans and bins of garlic give us a sense of order, they’re also the beginning of many excellent meals.

The question is, what should you buy? Here are some of my personal strategies for buying wisely and eating well.

Pasta: It’s nice to have both long, thin pasta (like spaghetti or linguine) and short, textured pasta (like fusilli or orecchiette) on hand. Having both keeps meals from getting repetitive. And if you’re a boxed mac and cheese fan, stocking a couple of those is never a bad idea.

Rice: Brown, white, long-grain, short-grain, I always have them all around, plus Arborio for rice pudding and risotto.

Stocks and Broths: Whether meat- or vegetable-based, boxed broths are essential for soups, stews, and make the base of pan sauces. And they won’t take up valuable freezer space.

Beans: Home-cooked dried beans taste better than canned beans; canned beans are more convenient and faster than the dried kind. It’s always good practice to have both.

Cured Meats: Cured meats keep for weeks in the fridge, and a chunk of smoked ham or salami in your bean pot adds so much flavor. But don’t forget the bacon.

Eggs: They’re a welcome addition to so many dishes — and, of course, stand on their own. Not to mention, they keep for a long time in the fridge.

Frozen Fruits and Veggies: Use the fruit in smoothies, and the vegetables in soups, stir-fries and stews. I’m partial to frozen spinach, artichokes, kale, corn, peas and lima beans. As for fruit, I like blueberries, mixed berries, peach, mango and cherries. (I also like to throw ripe bananas into the freezer, to extend their lives a little.)

Canned FishAnchovies, sardines, tuna and salmon are the building blocks of many of my favorite meals. Anchovy toast is a staple at my house.

Tahini and Peanut Butter: For hummus, for sauces, for salad dressing, for cookies, for sandwiches, for snacking. To mix things up, try using peanut butter in your salad dressings, and tahini on your jam sandwiches. Almond and cashew butters are also great pantry additions, if you prefer.

Parmesan and Other Hard Cheeses: These kinds of cheeses last for months in the fridge if you buy blocks rather than pre-grated. Or store the pre-grated kind in the freezer. You can also buy some cheese sealed in wax, which increases how long you can store them. Cream cheese is also important, for bagels and otherwise.

Olive Oil, Vinegar, Lemons: I can’t cook without them.

Nuts and Dried FruitFor snacking and baking.

Flour, Sugar, Yeast: For baking projects.

Butter: It will keep for weeks in the fridge and longer in the freezer.

Garlic, Onions and Shallots: No pantry is complete without them.

Root Vegetables: Potatoes, sweet potatoes, beets, carrots, parsnips, turnips, radishes. Radishes and turnips are excellent in salads and last for weeks in the produce drawer. If they get soft, soak them in a bowl of ice water until they firm up. Consider ginger for stir-fries and making into tea.

Celery: Use the leaves as an herb and the stalks in salads. Or stuff them with peanut butter or tahini for snacks.

Scallions: If you leave the roots on and put scallions in a container of water on the counter, you can cut off the green tops, and they will grow back three or four times. My mom taught me this trick.

Spices: If can’t remember when the last time you bought new spices was, consider buying some the next time you’re at the store: Fresh spices have so much more flavor than old ones.

© 2020 The New York Times