Trying to time the market is unwise. As study after study has found, trying to pick the perfect time to buy stocks doesn't work.

Instead, it's best to buy and hold. That means selecting certain high-quality stocks and holding them for the long term -- five, 10, 30 years or even longer.

With that in mind, let's look at three stocks that could fit the bill as "forever" stocks -- ones worth owning for many years to come.

Laptop screen showing coins with plants growing on them.

Image source: Getty Images.

1. Airbnb

The first stock worth keeping forever is Airbnb (ABNB 0.75%). When it comes to Airbnb, I'm following famed investor Peter Lynch's advice: Buy what you know. You see, I've stayed in plenty of Airbnbs and enjoyed it immensely over the last few years. The company's online platform connects guests and hosts. It's simple and straightforward. Moreover, it makes planning trips fun!

In addition, it's hard to argue with the numbers. Simply put, Airbnb's level of growth is hard to find. The company is growing quarterly revenue at 18%. That's impressive, but even more so given that revenue in its most recent quarter (the three months ending on June 30) is now $2.5 billion.

And other key metrics are rising, too. Over the last 12 months, free cash flow swelled to $3.9 billion, and net income soared to $2.3 billion. What's more, Wall Street expects the growth to continue -- despite lackluster forecasts for the overall economy. Analysts predict Airbnb will generate $10.5 billion in revenue in 2024.

In brief, the company's growth trajectory remains intact. So, for investors looking for a growth stock to own for the long term, Airbnb is a name to remember.

2. Costco

The next stock that I think can be held forever is Costco (COST 1.01%). Like so many great buy-and-hold stocks, Costco has a simple business model that generates a steady stream of revenue and profits.

The company operates 861 stores, selling everything from canned hams to robot vacuums. What's more, Costco maintains a vast membership program, with almost 125 million cardholders who pay $60 (or more) annually. As a result, the company is a go-to retailer for millions of consumers. 

Granted, Costco's growth has slowed as consumers feel the pinch of inflation. In its most recent quarter (the three months ending on Sept. 3), total same-store sales grew only 1.1%, which management blamed on lower sales of discretionary items such as electronics, furniture, and appliances.

Nevertheless, Costco could spur growth by hiking the cost of its membership fee, which it hasn't done since 2017. And once inflation is fully tamed, Costco will stand to benefit from a bounce-back in discretionary spending -- making Costco a forever stock worth considering.

3. Alphabet

Last up is Alphabet (GOOG 9.96%) (GOOGL 10.22%). It's a stock you can keep forever for a simple reason: It dominates the online search market.

According to Statista, Google captured 58% of global search ad revenue in 2022. Given that the overall digital ad market is expected to grow to nearly $400 billion by 2027, Alphabet's future looks rosy to say the least.

True, Google's leadership in online search is not a given, and competitors are eager to snatch a greater share of those lucrative ad dollars. However, Google has found ways to brush off challengers in the past, and with new features like artificial intelligence integrations, it seems unlikely that Google's reign as the king of search will fall apart overnight.

Investors would be wise to buy and hold this tech megacap for years -- rather than trying to time the market.