The U.S. is currently in a pandemic-induced recession that's forced millions of Americans out of their jobs. Theories about how long the recession will last and how deep it will be vary, but it's clear the recession will likely last longer than some economists had originally thought. 

You might think investing in stocks wouldn't be a good financial move right now, but you'd be wrong. If you've set aside enough money to cover your expenses for at least three to six months, and you won't need your cash for any major purchases over the next few years, then investing should be on your to-do list, recession or not. 

The market has been volatile this year, to be sure, but investing in stocks is still one of the best ways to build wealth over the long term. And to help you get started, it's worth taking a look at what Square (SQ -1.68%), Amazon.com (AMZN -1.65%), and NVIDIA (NVDA 3.71%) are doing.

A cracked hundred dollar bill.

Image source: Getty Images.

1. Square 

Square may seem like a counterintuitive stock to buy during a recession, considering that the company facilitates payments between businesses and customers. Many people are cutting back their spending right now, but it's important to realize that not all spending will dry up. More importantly, the spending that does occur is more likely to occur online, and through digital payments, because of people's fear of COVID, and that's where Square shines. 

The pandemic helped boost Square's gross payment volume (GPV) from its online channels by 50% year over year in the second quarter. The jump helped boost Square's gross profit by 28%. Second-quarter net revenue was up 64%.

Square's popular peer-to-peer payment app, Cash, is benefiting from the move to cashless transactions, too. The app had more than 30 million monthly active users at the end of June, and its revenue spiked 140% in the second quarter to $325 million. 

Investors would be wise to also consider that the e-commerce market has grown during the pandemic, making Square's business even more important. E-commerce now accounts for 16% of total U.S. retail sales, up from 11% last year, which means that Square's services are likely to be even more in demand in the coming years.

2. Amazon 

Amazon may be one of the best recession-proof stocks around because the size and scope of its e-commerce business is nearly unmatched and it's also got a powerhouse of a cloud business. As demand for online shopping spiked over the summer, Amazon's sales surged. Revenue jumped 40% in the second quarter, and the company's earnings skyrocketed to $10.30 per share, obliterating Wall Street's consensus estimate of $1.50 per share. 

Amazon is in a unique position to grow during recessions because the company sells so many products that people need, and it delivers them to customers quickly and efficiently. A surge in demand caused some delivery delays earlier this year, but Amazon has mostly gotten things back on track. As social distancing and working from home are a normal part of many people's lives now, Amazon's e-commerce business is sure to continue benefiting. 

Additionally, the pandemic has brought an increase in internet demand, which is helping Amazon's cloud computing business, Amazon Web Services (AWS). AWS is Amazon's most lucrative business, and it's tapping into what's estimated to be a $500 billion cloud computing services market in 2023. Even during a recession, many online businesses will host their websites and services through AWS, and with the company already holding 33% of the market, Amazon is perfectly positioned to grow AWS during tough economic times.

3. NVIDIA 

Chip companies can sometimes suffer from the cyclical nature of the industry, but NVIDIA has proven that demand for its chips is still strong, despite a recession. For example, the company's graphics processing units (GPUs) are prolific in the gaming industry, and sales from this market grew 26% in the most recent quarter. 

While that's impressive enough on its own, NVIDIA's data center revenue outpaced gaming revenue for the first time ever in the second quarter. This means that the company now has two fast-growing sales segments, all of which helped boost NVIDIA's total sales in the most recent quarter by 50%. 

The company's GPU demand is surging even as the recession has taken root, and NVIDIA could be on the cusp of even more growth. NVIDIA recently entered into a deal to purchase ARM Holdings, which designs and licenses chips for smartphones, and the company expects to close the deal in the next 18 months. ARM's chip designs are found in 90% of smartphones, which would give NVIDIA an entirely new way of making money from the chip industry and will help it diversify its business even more. 

Don't overlook this one important investing step

If there's one sure thing right now, it's that the market will be volatile as investors continue to digest daily news of economic uncertainty, political rivalries, and the pandemic. This means that buying stocks with the intent of selling them again in just a few weeks, or even a few months, could be a recipe for disaster. Instead, consider buying these stocks and holding onto them for at least a few years, to give them time to not only ride out the current ups and downs in the market, but also to capitalize on their long-term growth strategies.