It's been a tough year for investors. Inflation at a 40-year high and tremendous market volatility have made it a challenging environment to earn a positive return. This has led a growing number of investors to look for alternatives to the stock market. And one asset looks increasingly appealing: real estate.

Real estate, unlike the stock market, has maintained strong returns and offers a hedge against inflation. But does that mean it's a good investment? Let's take a deeper dive into why it might be a good idea to buy real estate while stocks are plunging and why it might not.

The case for investing in real estate

Real estate can be a tremendous investment no matter what the stock market is doing. It's one of the time-tested ways to create passive income, build wealth, and grow net worth. I have actively invested in real estate, both through physical properties like rentals and real estate investment trusts (REITs) for over a decade, and don't plan to stop anytime soon.

Rental real estate in particular can be attractive today because it offers a hedge against inflation. Real estate values and rents tend to rise with inflation, meaning your investment holds its value rather than losing it due to inflation. Plus, short-term leases, like a residential one-year lease, allow investors to adjust rents to reflect rising costs while maintaining a desired return.

There's the added benefit of tax deductions through owning a rental property, like depreciation, which can lower your tax bill. However, like the stock market, there are more advantageous times to get into real estate than others. And a lot of signs indicate that right now might not be the best time.

The case against it

Month over month, data is rolling in further validating that the real estate market is cooling. Reduced demand from higher interest rates has made already pricey homes less affordable, and increased supply from sellers trying to lock in today's high prices is changing the market. Prices continue to rise despite the changes, but it's very possible that could change in the near future.

High mortgage rates and higher prices make it more difficult to earn positive cash flow, one of the cornerstones of investing in real estate, and could lead to vulnerability if we enter a recession. REITs are also hurt by high interest rates because they make borrowing more expensive and tighten the companies' margins, making it difficult to achieve the same return.

Focus on the discount

When the real estate market is down, pricing is more favorable, which means investors can lock in savings that will lead to superior returns down the road. Right now, prices are at historic highs, and mortgage rates are rising, making it one of the least affordable times to buy a property in recent history.

With the real estate market actively changing (with lots of signs it's changing for the worse), it's probably a good idea to hold off on buying physical property until things level out and investors have a better understanding of where pricing, demand, and values are headed for the near future.

It doesn't mean investors should steer clear of real estate altogether; they should simply focus on the discount. With the stock market down, there are several high-quality REITs trading for a major discount. I've recently added to several of my REIT positions, taking advantage of today's favorable pricing while adding to my portfolio.

For example, I recently purchased Iron Mountain (IRM -0.97%), a REIT that specializes in physical storage and data storage for more than 225,000 customers around the globe. Over the past three years, it produced just under a 24% annualized return, more than double the S&P 500. Plus it pays a 5% dividend return. It's in an essential industry, meaning it should maintain healthy performance even if the economy heads into a recession. And it is in a strong financial position.

When stocks are plunging, it can feel like a good time to pull your money out and invest elsewhere, but I highly encourage you to ride out the turbulence and simply seek out the best discounts available today. For right now in real estate, that means REITs.