Unless you’re willing to eat takeout for every meal, regular trips to the grocery store are necessary. You may not be able to avoid them, but you can reduce the number of supermarket trips you take by planning ahead and building smarter shopping habits. That way, you can spend less time navigating crowded aisles and spend more time enjoying your quiet dinner in. We spoke with Heather Ramsdell, editorial director for The Spruce Eats, about the best ways to optimize your grocery runs.

1. Shop from your pantry first.

If your pantry is well-stocked, consider waiting a while before spending money on perishables. Many pantry items—like pasta, rice, beans, and canned vegetables—make hearty and nutritious meals. These foods are especially good to have on hand at the end of the week when you’re running low on fresh meat and produce. “Before you go shopping, understand the food you already have and when it needs to be eaten.” Ramsdell tells Mental Floss. “This sounds so boring and time-consuming but it’s worth it.”

2. Memorize recipes that use forgotten foods.

The sad head of lettuce in the back of your fridge or the old loaf of your bread on your counter can be transformed into a comforting meal with the right recipe. Memorize a few recipes and figuring out what to do with groceries that are about to expire becomes a lot less stressful. “Some recipes are made to use up leftovers and foods about to turn," Ramsdell says. "Soup, frittatas, salads, all-in-one pastas, and savory bread puddings are delicious ways to eat up the odd carrot, mildly wilted greens, and nearly stale bread hanging out in your kitchen.”

3. Optimize your meal rotation.

Heading to the supermarket without a plan leads to food waste. By cooking a bunch of new recipes that require different sets of ingredients each week, you’ll end up with bags of unfinished groceries cluttering your fridge. A smart alternative is choosing a few, reliable meals that make good use of whatever’s in your kitchen. “Instead of making a dozen dishes a month from a number of cuisines, focus on a few, perfect them, then create a rotation that makes sense over time,” Ramsdell says. “You can vary spices or toppings so that you don’t get bored.”

4. Aim for two-thirds pantry items and one-third fresh.

Buying mostly nonperishables means you won’t be in such a rush to cook your groceries after you bring them home. To make sure the perishable items in a grocery haul (ideally one-third of it) do get eaten, Ramsdell uses this guideline: “Center your meals around the longest lasting foods in your pantry, like rice, cornmeal, tortillas, pasta and dried beans, hard cheeses or frozen foods. Then add fresh foods as flavorings or side dishes for color, freshness and variety. Learn which foods last longest. Eat the fresh meat, fish, and more fleeting veggies and fruits like peaches, melons, tomatoes, and berries soon after your trip. Oatmeal is great with fresh fruit. Rice lasts for a long time. Make rice bowls using your perishable goodies.”

5. Take advantage of your freezer.

Your kitchen inventory shouldn’t just be stored in the fridge and pantry. According to Ramsdell, your freezer is an invaluable resource. “Frozen food is there for you,” she says. “Frozen vegetables require less prep and are often more nutritious than fresh. They are also sometimes more affordable.” Even if you buy groceries fresh, sticking food in the freezer before it hits its expiration date is an easy way to extend its shelf life.

6. Experiment with meal-planning apps.

Even equipped with the advice above, buying two-weeks-worth of groceries at once can feel overwhelming. If you’re still plagued by meal-planning stress, don’t hesitate to use an app for guidance. Ramsdell recommends a few options: “There are so many out there for every kind of person. Are you a ‘Type A’ meal prepper? Use MealPreppro. Are you cooking on a budget? Try Meal Board. Want to make sure that you don’t toss a morsel of food in the trash? Big Oven is great for suggestions on how to use leftovers.”