Research suggests that taking a loss on an investment is an emotional pain that investors try hard to avoid. It is why we hold a losing position in the hope that it will at least get back to breakeven, so we can sell it without losing money.

There's another way to go here, since you can use realized losses to offset profits from your winning investments. And that's exactly what I'm doing with 3M (MMM -0.48%). Here are the tax-friendly moves I'm making.

A big enough loss

The basic story here is that I'm harvesting tax losses so I can take advantage of the benefits offered by Roth retirement accounts. But there are some important nuances that come into play.

I don't usually consider selling a stock at a loss unless at least one of two things takes shape. First, something material needs to change, either at the company itself or in my thinking about that company. The second is that the loss is big enough that I can actually use it for tax-loss harvesting. A few hundred dollars in paper losses is noise; $10,000 is a usable figure.

An investor looking at trends on a computer.

Image source: Getty Images.

Sadly, industrial giant 3M ticked off both boxes. I became uncomfortable with the lack of information about legal and regulatory problems, and (after my purchase) management decided to spin off the growth-oriented healthcare division. So the situation changed, and the paper loss I was sitting on ballooned to a sizable figure -- enough to offset paper gains I had on some of my real estate investment trusts (REITs).

REITs are interesting because they are specifically structured to pass income on to investors without that income facing corporate-level taxation. In exchange for that benefit, investors have to pay taxes on the income at their personal income tax rate. That's a fair trade-off, but there's a way around that tax if you have a Roth retirement account.

Moving money

Essentially, funding a Roth account is done with money on which you have already paid taxes. Thus, when you retire and start to withdraw the cash, it comes out of the account tax-free. So, if you buy income-producing stocks in a Roth account -- either a Roth IRA or a Roth 401(k) -- the income is effectively tax-free. In retirement, that can save you from having taxable income, which can lead to issues with things like Social Security and healthcare costs.

I own a number of REITs in my taxable accounts, including Realty Income, W.P. Carey, and Simon Property Group. My game plan is to take the lemons I have with 3M (my now-realized losses) and turn them into lemonade by moving a REIT to my Roth account. That has to be accomplished by selling the shares and realizing a gain, with the profits I make offset by the loss from 3M. After I repurchase the REIT in the Roth account, the income it generates will be tax-free.

There are downsides. For starters, there are commissions that have to be paid. They are small, so I'm not worried about them. More notably, the income I used to generate in my taxable account from the REIT is now gone, so I don't have the ability to spend it if I need it. That income is locked into my Roth, which I can't easily touch without potential penalties until I retire.

With my daughter now an adult and her college education largely paid for, I am comfortable with the income staying inside the retirement account. Prior to this point, however, I viewed that income as an insurance policy against hard times, and I probably wouldn't have made this shift.

Next steps

At this point, I've sold most of my 3M position, so I have the tax loss. Although I can carry a loss forward into the future, I have given myself until the end of the year to sell a REIT and "move it" by reacquiring it in my Roth.

That shift will probably happen sooner rather than later, but I have to select the right REIT, comparing things like yield (Simon has the highest yield, Realty Income the lowest), dividend frequency (Realty Income pays a monthly dividend), and the capital gains I'll realize.

But in the end, I'm not just taking my lumps from 3M, I'm using the loss to good advantage. That's something any investor can do to make a realized capital loss a lot less emotionally painful.