The year is rapidly coming to a close, and if you’ve sold any investments at a profit this year, you should anticipate paying capital gains taxes when you file your tax return — that is, unless you take advantage of tax-loss harvesting, which is the practice of selling losing investments in order to offset your profits. Here’s how it works, and what you need to know.