Rising inflation and general economic woes have weighed on the market for a while -- and now, the Federal Reserve is predicting a "mild" recession on the horizon. While a recession is never great news, it's also no reason to panic. These slowdowns are temporary situations. And history shows us they're followed by strong periods of growth.

Meanwhile, what should you do? You can start by following in the footsteps of someone who has invested through many recessions -- and has come out as a winner over time. I'm talking about billionaire investor Warren Buffett. Here are two top Buffett stocks to buy now. They have what it takes to help your portfolio through a recession -- and excel over the long term.

1. Coca-Cola

Coca-Cola (KO 0.15%) may not offer the super-charged growth of young up-and-coming companies. But Coca-Cola's brand strength and solid business mean it can manage well during tough times. The world's biggest nonalcoholic beverage company recently reported a 5% increase in first-quarter net revenue and a 12% gain in earnings per share -- even in a difficult economic environment.

The company has 26 billion-dollar brands and works hard to address the needs of each different market. For instance, in North America, it's expanding the Fairlife milk brand. Fairlife became a billion-dollar brand last year and has increased volume in the double digits for eight straight years.

Coca-Cola's success has a lot to do with its ability to bring the right product, package, and price point to each market. All of this should help the company navigate rough economic times -- and grow once the situation improves.

Buffett surely likes all of those points about Coca-Cola. But what he may appreciate even more is the company's commitment to sharing its successes with shareholders. Coca-Cola pays an annual dividend of $1.84 per share, representing a dividend yield of 2.88%.

The company is a Dividend King, meaning it's lifted its dividend for more than 50 years. It's unlikely to break that record now. And that means you can count on passive income from Coca-Cola, even during the worst market times.

2. Johnson & Johnson

Johnson & Johnson (JNJ 0.29%) is a top stock to hold during a recession. That's because this healthcare giant's earnings don't depend on what the economy is doing. No matter the situation, people still need their medicines and surgical procedures. And J&J is putting its focus on both of these areas now more than ever.

That's because J&J is about to spin off its consumer health business -- the unit that brings us products like Aveeno skincare and Tylenol -- this year. Consumer health has been J&J's slowest-growing business and has contributed the least to revenue compared to the company's two other businesses. J&J now will direct all of its attention to the stronger pharmaceuticals and medtech.

J&J aims to increase pharmaceuticals revenue to $60 billion by 2025, or $57 billion on a constant currency basis. That's up from $52 billion last year. The company's medtech platform also looks promising. The recent purchase of heart pump specialist Abiomed means medtech now has 12 platforms generating more than $1 billion in annual sales.

The company also heavily invests in research and development -- at the level of 14.4% of sales in the most recent quarter. That, and the more than 100 candidates in the pipeline are reason to be optimistic about future growth.

Finally, like Coca-Cola, J&J will pay you just for holding the shares. J&J offers you $4.76 a share annually at a dividend yield of 2.88%. So, buying this Dividend King is another way to secure growth for your portfolio -- even during a recession.