If you sell a stock for profit, you owe taxes on the profit.
However, if you sell a stock for a loss, you can offset that with the profits.
So if you have a stock you are negative in and you don’t think it will recover (or at least not by a worthwhile amount in a worthwhile time), you can sell it and then when you sell another stock for profit, and you can minimize (or even eliminate) taxes owed.
EDIT: You can buy back the the stock/fund you sold after about a month, so you kind of reset where your starting point is at (and usually the prices haven’t changed a ton in a month,) and you lowered the taxes you’ll owe on profits from others stocks/funds.
Latest Answers