Inflation has made headlines for the last 18 months as consumers continue to battle the impact of rising prices at the gas pump, the grocery store, and even the car dealer. 

The core measure of inflation is the Consumer Price Index (CPI), which is reported by the U.S. Bureau of Labor Statistics once per month. The annualized figure tends to grab attention, as it shows how much prices have risen compared to where they were in the same month of the prior year.

The U.S. Federal Reserve maintains an annualized inflation target of 2%. For context, it kicked off 2022 at 7.5%, and had reached a 40-year high of 9.1% by June. The Fed was understandably concerned, and so it increased interest rates at the fastest pace in the institution's history.

Thankfully, those drastic measures appear to have worked. Annualized CPI has declined every single month since that alarming June number, and the March 2023 figure of 5% marked the largest decline since the peak.

A chart of annualized consumer price index inflation data, peaking in June 2022 and falling since.

Higher prices and interest rates constrained household finances, which hurt some companies more than others. But now that inflation is clearly cooling, the following two stocks might be smart buys.

1. Apple

With a market capitalization of $2.5 trillion, Apple (AAPL -0.35%) is the world's largest company. It achieved that prestigious title thanks primarily to its portfolio of consumer electronics like the iPhone, iPad, and Mac line of computers. 

While being a consumer products company has served Apple well throughout its 47-year history, it can be a curse in economic climates like the present one. When inflation is high, household finances come under pressure. It also drives up manufacturing costs at the same time, which shrinks profit margins. 

Expensive electronics are among the first items consumers slash from their budgets during tough times, which makes Apple vulnerable. In fact, a report by the International Data Corporation this week suggests Apple's Mac computer sales crashed more than 40% in the quarter ended March 31, compared to the same time last year. Investors will learn the official numbers when Apple reports its fiscal 2023 second-quarter results on May 4.

But evidence of a slowdown started stacking up during fiscal 2022 (ended Sept. 24, 2022), when the company grew its full-year revenue by just 7.8% to $394 billion. That was followed by a revenue contraction of 5.4% in the first quarter of fiscal 2023.

There have been bright spots, though, mainly in the company's services segment, which continued to grow despite the difficult economic conditions. It includes subscription-based services like Apple Music, Apple News, Apple TV, and iCloud, plus other innovative consumer programs like Apple Pay.

Since consumers are incredibly sensitive to the economic environment, Apple stands to benefit from a sustained decline in inflation and a pause on further interest rate hikes. Despite the company's sluggish growth recently, its stock has held up incredibly well. Apple is down just 10% from its all-time high, and history is proof any discount in this high-quality stock might be worth buying for the long-term.

2. Redfin

If there's a segment of the economy even more vulnerable to high inflation and rising interest rates than consumer products, it's the real estate sector. Redfin (RDFN 8.49%) has been a casualty of the broader environment, with shares down 90% from their all-time high. But some of the changes the company made to its business recently, combined with declining inflation, suggest the risk-reward equation might make a lot of sense at the moment. 

Last year, Redfin shut down its risky iBuying business, where the company was purchasing homes directly from willing sellers with the intention of flipping them for a profit. It's a great business model when home prices are consistently rising, but when they turn, sitting on an inventory of hundreds of properties that are falling in value can lead to catastrophic financial consequences.

Now that Redfin is out of that segment, it's focusing on what it has always done best: brokering. The company has 2,022 lead agents spread across America, covering 98% of the country's geographic real estate markets. That's a level of scale small, independent agencies can't compete with, and it's the reason Redfin can charge listing fees as low as 1%, compared to the industry standard of 2.5%.

On top of that, the company expanded into other verticals like rentals and mortgages -- the latter of which experienced explosive 337% growth in 2022 (year over year) with $4.3 billion in originations.

The absence of iBuying will leave a big hole in Redfin's revenue this year. Analysts expect the company to generate $1.1 billion, compared to $2.2 billion in 2022. However, management expects Redfin will be a healthier business as a result, with the potential to achieve positive adjusted earnings before interest, tax, depreciation, and amortization (EBITDA) this year.

Investors value Redfin at just $1 billion right now, which gives the stock a rock-bottom forward price to sales (P/S) ratio of less than 1. The company is now set up to perform when the environment improves, so Redfin stock could be a big winner if inflation continues to fall.