Tax-loss harvesting is the strategy of selling investments that have declined in value to generate a capital loss that offsets capital gains — or up to $3,000 of ordinary income per year. Unused losses carry forward to future years. The key: watch out for the wash sale rule, which disallows the loss if you buy the same investment back within 30 days. You can buy a similar (but not identical) investment to maintain your market exposure. This strategy is most effective in taxable brokerage accounts.