This gut-­wrenching year for stock investors may provide the best opportunities in more than a decade for cutting taxes. By selling stocks and/or funds that have suffered losses, you can offset gains on investments that have registered profits…and possibly lower taxes on regular income, too. But to take the greatest advantage of your so-called capital losses, you need to use the strategies that are described below and avoid making various ­mistakes…

Don’t abandon investments that you still believe in just to generate tax savings. Investors often sell an investment at a loss just before it rebounds. Consider selling an investment that has losses only if you don’t believe that it has good future prospects…it no longer fits into your strategy or your target mix of allocations…and/or you would not buy the investment at its current price. Alternatively, if you are selling a fund that you still like, consider investing in a similar fund at the same time, but don’t violate the “wash sale rule.” (See below.) 

Within 30 days before or after you sell an investment at a loss, don’t invest in one that is “substantially identical.” This could violate what’s known as the IRS “wash sale rule” and invalidate your loss for tax purposes. The rule applies even if the selling is in a taxable account and the buying is in a tax-advantaged account such as an IRA. It also applies if the investments are from different sources but virtually identical, such as the Vanguard S&P 500 exchange-traded fund (VOO)…Vanguard 500 Index fund (VFINX)…and SPDR S&P 500 ETF (SPY), which all track the same market index. 

Work-around strategy: Quickly buy a fund with similar characteristics but not substantially identical to the one you sell. For example, you could sell your S&P 500 ETF and buy a fund with the nearly identical top 10 holdings, such as the iShares Russell 1000 ETF (IWB). After 30 days, if you would rather sell your new investment and shift back to your original one, you can do so without running afoul of the wash-sale rule. 

Important: This strategy does not work well for individual stocks because it typically is difficult to find a stock that is similar enough to the one you might be selling.

Understand how short-term and long-term capital losses work. For instance, the IRS requires that short-term losses—those on investments held for up to one year—are used first to offset short-term gains…and long-term losses are used first to offset long-term gains. However, whatever losses of either type remain can then be used to offset ­losses of the other type. If you have lots of short-term capital gains, the use of losses to offset those gains can be especially valuable because short-term gains are taxed at your ordinary income tax rate while long-term gains have a lower tax rate (20%, 15% or 0%, depending on your income level). 

Remember to use leftover capital losses. Once you have run out of capital gains to be offset by capital losses, the IRS allows you to deduct your capital losses from other kinds of income, including wages and interest, up to an annual limit of $3,000—or $1,500 if married and filing a separate return. Any amount remaining beyond that annual cap can be carried over to subsequent years to offset new capital gains first, then income, so it’s important to keep accurate records.