Many investors kept their powder dry throughout much of 2022. You can't blame anyone for building up their cash stockpiles amid significant market volatility. However, at least some of that cash could be coming off the sidelines now, with the stock market trending in a positive direction so far this year.

Where should investors put their cash to use? There are plenty of good opportunities. Here are my picks for the best stocks to invest $5,000 in right now.

1. Amazon

When Bill Miller says a stock is a great pick, it pays to listen. And that's exactly what the famous investor said about Amazon (AMZN 0.65%) in January. Specifically, Miller called Amazon "one of the easiest names in the market right now." I agree.

This optimism about Amazon isn't just because the stock remains more than 40% below its previous high (although that is the case). The main reasons to invest in Amazon are that (1) the company's outlook is improving, and (2) its valuation doesn't reflect this improvement.

As exhibit A, look at inflation. Federal Reserve chairman Jerome Powell stated this week that the "disinflationary process, the process of getting inflation down, has begun." That's great news for Amazon, which has blamed its slowing growth, in large part, on sky-high inflation.

Also, Amazon has cut costs. These moves should lead to increased profitability and stronger free cash flow. If a new bull market begins, Amazon should be among the big winners as investors gain a newfound appreciation for this beaten-down e-commerce and cloud-hosting giant.

2. Alphabet

Never underestimate Alphabet (GOOG 0.36%) (GOOGL 0.38%). Though, I think some investors have ignored that advice lately. They went along with the spiel that OpenAI's ChatGPT presented something close to an existential threat to Google. I suspect that we'll soon see otherwise.

Alphabet is launching its rival to ChatGPT, Google Bard. To be sure, the initial release will be based on what the company calls its "lightweight" version of its large language model LaMDA. That could mean users will see more inaccuracies than they'd prefer. However, it's only a matter of time before the full-blown version will be available.

But don't invest $5,000 in Alphabet stock just because it might have the next shiny new toy that generates a lot of buzz. Incorporating LaMDA into Google Search could ultimately boost ad revenue rather than cause a decline, as some anticipate. Alphabet's integration of tools and application programming interfaces (APIs) for AI technology into its Google Cloud services could also attract more customers to its fast-growing cloud-hosting business.

Like Amazon, Alphabet should benefit if the macroeconomic picture improves. When that happens (which it will sooner or later), the stock will almost certainly soar as advertising revenue again picks up steam.

3. Vertex Pharmaceuticals

I could sing the praises of Vertex Pharmaceuticals (VRTX 1.04%) until I'm blue in the face. But I won't. Instead, let me point out just three compelling reasons to buy the stock right now.

First, Vertex is pretty much insulated from what happens with the economy. Patients will take its cystic fibrosis (CF) drugs, and insurers will pay for those drugs regardless of the inflation and gross domestic product (GDP) numbers. This gives Vertex a level of resilience that most stocks simply don't have. We saw that to good effect during the dismal market environment last year.

Second, Vertex has a clear catalyst in the near future. The company and its partner, CRISPR Therapeutics (CRSP -0.92%), could receive regulatory approvals for exa-cel as soon as the second half of this year. The therapy, which holds the potential to cure sickle cell disease and transfusion-dependent beta-thalassemia, is on track to become the first CRISPR gene-editing therapy on the market.

Third, Vertex's long-term prospects look even brighter. CEO Reshma Kewalramani said in the company's recent quarterly update that Vertex could launch new products for five disease areas within the next five years. She stated, "Each program holds the potential to be best-in-class and transform the disease, and each represents a multibillion-dollar market opportunity."

An ability to perform well during good and bad markets. A major catalyst on the way. Exceptional long-term growth opportunities. If that's not enough to attract some cash from the sidelines, I don't know what will be.