What type of stock should you buy and hold until retirement? The company can be in any sector. It can be a growth stock or a value stock. But the company should have these two things: a track record of earnings performance and strong future prospects. In addition to this, if the stock pays a dividend, that's a bonus.

Below, I'll talk about two hot stocks that have proven themselves and are set to deliver profit and revenue gains over the long term. One is a pharmaceutical company making one of the world's most in-demand products today. The other is a leader in two growing fields. Let's take a closer look at both.

A person smiling and talking on the phone while holding a tablet.

Image source: Getty Images.

1. Pfizer

Pfizer's (PFE 0.88%) earnings took off, thanks to its coronavirus vaccine. That product generated more than $36 billion last year. And Pfizer reported $81 billion and $25 billion in annual revenue and profit, respectively. This year, we can count on the vaccine and Pfizer's coronavirus pill Paxlovid to make significant contributions to earnings, too.

Once the pandemic shifts to endemic, though, this pharmaceutical giant still remains a solid player to have in your portfolio. First, coronavirus-program revenue likely will remain at blockbuster levels for some time -- even if it falls from today's level. Second, Pfizer sells eight other blockbuster drugs in a variety of treatment areas. Of course, some of those will face generic competition by the end of the decade.

But here's the good news: Pfizer's pipeline is full. And many of the products are in late-stage development. Pfizer's pipeline includes 89 candidates. Today, 27 are in phase 3 trials.

Pfizer also has committed itself to growing its mRNA platform. For example, it signed an agreement with Acuitas Therapeutics to license that company's lipid nanoparticle delivery technology for as many as 10 vaccine or therapeutic-development targets. Pfizer already uses this technology in its coronavirus vaccine.

Pfizer also offers the bonus of an annual dividend. This year, it totals $1.60, with a dividend yield of 3.1%. And we may expect dividend increases. CEO Albert Bourla said in the most recent earnings call that the company would continue to develop its business "while still maintaining our growing dividend."

2. Amazon

Amazon (AMZN -0.34%) has jumped into the spotlight recently due to its upcoming stock split, but that's not the reason to buy Amazon. The reason to buy and hold this stock is due to its strengths in two growing businesses: e-commerce and cloud computing.

E-commerce sales are set to reach more than $1 trillion this year in the U.S., according to Insider Intelligence. The global cloud-computing market, at a compound annual growth rate of more than 16%, is expected to reach $947.3 billion by 2026, a Markets and Markets report shows.

Amazon is a leader in both industries. In retail, its Prime subscription service has helped the company gain and keep customers. As part of the deal, they get various quick and free delivery options on orders. And subscribers have access to an enormous selection of entertainment options, including books and movies.

Amazon Web Services (AWS) -- the cloud-computing business -- has fueled Amazon's profit. The business last year represented 74% of the whole company's operating income.

Of course, Amazon has suffered from labor shortages and inflation, just like other retailers. But this is a temporary situation. And Amazon has taken action to keep revenue growing. For example, it recently increased the price of its Prime subscription in the U.S.

What about the upcoming stock split? It may encourage some investors to buy the stock because each share will trade at a lower price -- and that makes it easier to take a small position in a company. But overall, continued growth in retail and AWS are the real catalysts for share-price performance. They should keep Amazon's revenue and profit engine going.

Pfizer and Amazon are big names today but are likely to stay in the forefront over the long term -- thanks to their focus on the future. Share-price gains might not be overnight, but earnings growth should drive share increases over time. And if you hold on to these stocks, that's great news for your retirement.