How Are Capital Losses Used to Offset Capital Gains?
Capital losses are first used to offset capital gains of the same type (short-term losses against short-term gains, long-term losses against long-term gains). If there are net losses in one category, they can then be used to offset gains in the other category.
This netting process reduces the total amount of taxable capital gain, thereby lowering the tax bill.