Talks about a potential recession have picked up as the federal funds rate chugs higher to combat inflation. It may get a lot of press, but don't let fears of a potential recession get to you. The economy has always had its ups and downs, and the stock market has continually recovered to reach new highs.

Does that guarantee the future? Of course not, but it's a helpful reminder of how resilient the stock market has been throughout history. So while there isn't anything you can do to prevent a recession from happening, you can control what you do about it.

Here are three tips for getting through a recession with your portfolio intact.

Children with light bulb hats.

Image source: Getty Images

1. Maintain the right mindset

Your mindset is the foundation of all the decisions you make. Have a pessimistic attitude, and you might make a different decision than when you feel optimistic. A recession can be stressful for your portfolio, impact your job, and be difficult for anyone.

Try to keep a positive attitude and avoid irrational, shortsighted decisions. For example, many investors panicked during the 2008 financial crisis, selling their stocks at low prices when the market crashed. Unfortunately for many, fearful emotions scared them out of good companies. Those stock prices eventually recovered when the crisis passed, but many weren't holding the stocks anymore and missed the recovery.

You must always do what's best for your situation, but avoid making decisions you might regret later. Recessions and market crashes can be scary, but they're a normal part of how the economy functions.

2. Avoid margin, add savings

Borrowing money to invest, called margin, is one of the easiest ways to destroy a portfolio. Margin can amplify your investment returns because you borrow money to buy more shares. You'll enjoy the gains on the shares you purchased out of pocket and those purchased with borrowed money. Ideally, you can sell enough stock to pay back the original amount you borrowed and pocket the rest.

But the knife cuts both ways; you'll lose more if the share price drops because you still owe the original amount you borrowed. In a rocky market, like during a recession, your losses could get bad enough that you receive a margin call from your broker, potentially forcing you to sell your stocks at huge losses to pay back your loan. You don't have to worry about this situation if you avoid margin altogether.

On the other hand, consider adding new funds to your portfolio when the market is struggling. Volatile markets can make the share prices of good companies fall for no reason. If you're consistently adding new funds, you can take advantage of any potential deals the market offers during tough times.

3. Concentrate on quality stocks

Lastly, pay close attention to the stocks you let into your portfolio. You can think of the stock market as a tide, which can raise and lower all the boats as it goes up and down. Stock prices can act the same way in the short term. Prices of low-quality companies can soar when investors get greedy during good times.

Person inspecting document with magnifying glass.

Image source: Getty Images

However, a bear market can come and wipe out the irrational exuberance. Some stocks will recover with good fundamentals, like healthy growth and strong financials. On the other hand, many poor-quality stocks will plummet and never come back. For every Amazon in the early 2000s, a handful of Pets.coms and other unprofitable businesses didn't survive.

Focus your investment strategy on proven, profitable companies. If you invest in unprofitable companies, understand the business model and ensure it has a healthy balance sheet to help it through a recession. As Peter Lynch once said, it's hard to go bankrupt if you don't have any debt.

Keeping these three tips in mind will help you not only get through a recession with a sound portfolio, but it could set you up for massive gains during the next bull market.