It has been quite an interesting year to be a stock market investor -- to say the least. U.S. inflation soared to a 40-year high in June, climbing 9.1% from a year ago and marking the largest year-over-year increase since the early 1980s.

In July, the Federal Reserve increased interest rates by 75 basis points for the second consecutive time to combat rising prices, and many investors believe it may do so again in its upcoming September meeting. To contextualize just how rare -- and aggressive -- the Fed's latest moves have been, the central bank has not hiked interest rates by 75 basis points since 1994.

To add fuel to the seemingly endless fire, the war in Ukraine has had a string of negative global economic consequences.

Considering all of this, should investors postpone buying stocks for the time being? I don't think that would be the best idea. In fact, it's important to continue investing even during economic downturns -- that's when the best long-term investments can be made.

But if you're a risk-averse investor and concerned about the economy's near-term trajectory, Costco Wholesale (COST -0.24%) could be a great stock to turn to right now.

Close-up of person shopping in store.

Image source: Getty Images.

Costco in today's economy 

Costco is an intriguing buy in today's market environment for two reasons: its membership model and pricing power. Together, these two components allow the retail leader to operate an extraordinarily consistent business. In its most recent quarter, the company's revenue from membership fees rose 9.2% year over year to $984 million, representing less than 2% of its $52.6 billion in total revenue.

Not so fast, though -- its net profit finished at $1.4 billion in the quarter, meaning that membership fees made up 72.7% of the retailer's bottom line. Thus, its membership-only business model, which boasts a 92.3% renewal rate in the U.S. and Canada, is the primary driver of its profitability. Because customers consistently renew their memberships, Costco can expect net profit to be consistent, even during an economic down period. 

To boot, the company hasn't increased its membership fees since 2017. CEO Craig Jelinek noted in June that Costco wasn't planning to raise member fees in 2022, so that appears unlikely to occur this year amid high inflation. Currently, a standard Gold Star membership at Costco carries a price tag of $60 annually, equal to just $5 per month. Given that Costco typically hikes its membership fees every five years or so, investors should be on the lookout for an increase in the future. All else being equal, higher membership fees should lead to higher net income for the retail juggernaut.

And then you have Costco's pricing power. Because the company buys and sells items in extreme bulk, it's able to negotiate favorable deals with vendors. By bargaining with its vendors, the retailer can offer its members unequaled low prices -- which keeps customers coming back time and time again. Especially in today's macro environment, where consumers are highly sensitive to rising prices, Costco is an extremely attractive shopping destination. This is evidenced by its top- and bottom-line growth of 16.2% and 10.9%, respectively, in its third quarter. 

Should investors pull the trigger on Costco stock right now?

Costco stock has dropped 6.5% year to date, and it currently has a price-to-earnings (P/E) multiple of 41. The company has always commanded a premium valuation relative to retail peers like Walmart and BJ's Wholesale, which carry P/E multiples of 27 and 22, respectively. Even so, Costco is trading above its mean multiple of 36 over the past five years.

While I think that Costco is an unbelievable company and a safe play on the darkening economic environment, I don't think that today is an ideal entry point. Interested investors should wait until the stock dips below its five-year mean valuation levels before buying the stock.