Investors & landlords

Besides selling some other stock that has a loss, there is no way to avoid the capital gains tax.

If you sell stock at a loss, after 30 days, you could buy it back it you want to.

Within 30 days, your loss is disallowed.