In 2022, the Nasdaq-100 Technology Sector index plunged almost 40% after macroeconomic declines led to reduced spending in the industry. As a result, many of the world's most valuable companies experienced steep declines in their share prices.

The economically challenging year highlighted the importance of holding stocks for the long term because your investment may just be facing temporary headwinds. For instance, many stocks have been rising since the start of 2023, which would be a missed opportunity for those who sold at the bottom last year. 

So, want to get richer? Here are three stocks you can buy now and hold forever.

1. Amazon 

Amazon (AMZN -0.09%) had a worse year than most in 2022, with its stock falling 49.6%. The decline was mainly due to challenges in its e-commerce segment, which reported operating losses totaling $10.6 billion for the year.

Despite the losses, Amazon proved the strength of its diversified business model with its cloud platform, Amazon Web Services (AWS), earning 100% of the company's $12.2 billion in operating income. AWS also reported a year-over-year revenue increase of 28.7% to $80 billion.

Amazon may have started 2023 at a disadvantage, but it remains one of the best growth stocks out there. The company's shares have risen 23% over the last five years and 609% over the last 10 years. Meanwhile, its annual revenue has increased 189% to $513.98 billion since 2018, and operating income has soared 198% to $12.2 billion over that same time frame.  

In the coming years, Amazon's leading market share in e-commerce and cloud computing will likely continue to pay off. Despite recent declines in its online retail business, the market still has plenty of room for growth, making Amazon's stock an excellent investment to buy now and hold forever.

2. Apple

Apple's (AAPL -0.82%) stock is always easy to recommend and makes a great addition to almost any portfolio. For instance, while the Nasdaq-100 Technology Sector index tumbled 40% in 2022, the iPhone maker proved its resilience by falling a more moderate 26.8%. Apple's stock also fared better than many of its peers amid economic challenges, as seen in the chart below. 

AAPL Chart

Data by YCharts

Moreover, Apple has offered investors significant gains over the long term. Since 2018, the tech giant's stock has climbed 233%, and it's soared 837% since 2013. The impressive returns have come alongside five-year revenue growth of 130% to $394 billion, with its operating income increasing 144% to $119 billion during that time frame.

With reliable and consistent growth, it's not surprising Wall Street mogul Warren Buffett allocated 41.3% of Berkshire Hathaway's portfolio to Apple shares. In fact, Buffett saw the company's stock dip last year as a buying opportunity, boosting Berkshire's stake in the fourth quarter of 2022 by $3 billion.

Apple's stock has risen 179% since Berkshire first invested in 2016.  The growth is thanks to its almost unparalleled brand loyalty and a walled garden of products that brings consumers deeper and deeper into its ecosystem with just one purchase. Apple's business has made it the world's most valuable company, with a market cap of $2.35 trillion, making it an excellent stock to hold indefinitely. 

3. Advanced Micro Devices

Advanced Micro Devices (AMD -0.17%) was one of the hardest-hit companies last year, with its stock plummeting 55%. The business suffered from declines in the PC market, which saw worldwide shipments for components such as graphics processing units (GPUs) fall 42% year over year in the third quarter.

Despite the stock's substantial tumble, AMD shares have returned 538% in the last five years and over 3,000% in the last decade. Additionally, the company's annual revenue has increased by 264% to $23.6 billion since 2019, while operating income has risen 180% to $1.2 billion. AMD's growth has largely come from success in custom and consumer processors (CPUs), with its Ryzen series leading it to steal market share from Intel consistently. According to Statista, since Q2 2017, AMD's CPU market share has gone from 20.2% to 35.2%, while Intel's has gone from 79.7% to 62.8%. 

However, the biggest reason to invest in AMD is its resilience after a challenging 2022. In Q4 2022, the slumping PC market led the company's client and gaming segments to report revenue declines of 51% and 7%, respectively, year over year. As a result, AMD pivoted to more lucrative parts of its business, with its highest-earning division becoming data centers, which posted a revenue increase of 42% to $1.7 billion. Meanwhile, its embedded segment saw revenue grow over 1,800% to $1.4 billion. The redirection in its business meant the company retained growth despite market headwinds, with revenue rising 43.6% to $23.6 billion in its fiscal 2022. 

AMD has solid leadership, with CEO Lisa Su taking the company from the brink of bankruptcy prior to 2017 to a dominating position in tech. AMD's performance under pressure and immense long-term growth makes its stock one to buy and hold forever.