Worrying comes easily during difficult economic times. Even if your job is secure, your investments could be on shaky ground.

To be sure, there are some stocks that could be legitimate causes for concern during economic downturns. The underlying businesses of these stocks aren't built to hold up well in both good times and bad times.

However, there are other stocks that are the exact opposite. They're positioned to both survive and thrive regardless of what happens. If you're wanting to ride out the recession with no worries, consider investing $5,000 or so in these three stocks. 

Young couple sitting on couch and looking at a laptop screen

Image source: Getty Images.

Amazon.com

What caused the current recession? The COVID-19 pandemic, of course. And the coronavirus outbreak is the most likely culprit to extend the length of the recession beyond what anyone expects. Amazon.com (AMZN -1.14%) should continue to grow in spite of the pandemic -- and even because of the pandemic.

People across the world increased their online buying during the coronavirus-related lockdowns. As the largest e-commerce retailer in the world, Amazon was a prime beneficiary. The convenience of shopping online, combined with continued worries about COVID-19, should keep Amazon's sales momentum going even if the recession continues for a much longer period. 

Amazon's real growth driver, though, is its cloud hosting business. The good news for the company is that the same trends that are helping its e-commerce business should also boost its cloud business. Companies are shifting their online presence to the cloud to help keep up with the rapidly growing online consumer demand.

There are a couple of potential challenges for Amazon. Some want to break up the tech giant. If presumptive Democrat presidential nominee Joe Biden wins in November, Amazon could pay billions of dollars in additional taxes in the future. However, neither issue should be worrisome.

There's significant uncertainty as to whether Amazon would actually be broken up. The sum of the parts could be worth more than the sum of the whole even if it happens. And, like most companies, Amazon is adept at navigating tax code changes. It will no doubt be able to continue delivering strong growth even if its tax bill increases.

Dollar General

You might not think Dollar General (DG 0.82%) has a lot in common with Amazon. However, both companies have seen their businesses grow as a result of the COVID-19 pandemic. 

Consumers aren't buying everything online. There are still products that they prefer to purchase locally. Dollar General's retail stores are conveniently located for millions of Americans. The company also offers discount prices that are especially attractive as shoppers tighten their purse strings.

Before the pandemic hit, Dollar General invested in expanding the varieties of refrigerated and frozen products that it sold with its DG Fresh initiative. That turned out to be a brilliant move. The discount retailer also sells the staple products that people need regardless of how the economy is performing.

Don't think that Dollar General is only a tough-times play, though. The company is poised to succeed after the pandemic ends, just as it's done since its IPO in 2009.

Vertex Pharmaceuticals

Not worry about a biotech stock? That might seem crazy. After all, biotechs are known for their high levels of volatility and risk. But Vertex Pharmaceuticals (VRTX 0.10%) is a big biotech that should be a worry-free pick for years to come.

First of all, Vertex basically enjoys a monopoly in treating cystic fibrosis (CF). There are other approved drugs that treat some of the symptoms of CF, but none of them treat the underlying cause of the genetic disease as Vertex's drugs do. Also, the biotech's closest rival is still several years away from being in a position to launch a CF drug that could be competitive. That would happen only if the rivals' experimental drugs perform well in clinical testing, which isn't a sure thing. 

In addition, Vertex's sales are largely immune to the impact of the COVID-19 pandemic or an economic recession. As a case in point, the company's sales skyrocketed 62% year over year in the second quarter of 2019. 

Those sales will almost certainly soon jump even more. Vertex expects European approval soon for its newest CF drug, Trikafta/Kaftrio. The drug raked in nearly $1 billion in the first half of 2020 in the U.S. alone. 

Over the longer term, Vertex's pipeline has multiple candidates that could be big winners. One candidate that especially stands out is VX-814, which is in phase 2 testing for treating alpha-1 antitrypsin deficiency, a rare genetic disease that -- like CF -- is caused by protein misfolding issues.