There are a number of things you can do to minimize or even avoid capital gains taxes:Invest for the long term. … Take advantage of tax-deferred retirement plans. … Use capital losses to offset gains. … Watch your holding periods. … Pick your cost basis.