Sometimes it makes sense to take a look at the shares youre going to sell before you sell them to minimize your capital gain or maximize your loss. To minimize gain, you should sell the shares that have the highest basis. To maximize loss, you should sell the shares that have the lowest basis. If you dont identify the shares that you sell prior to selling them, the IRS will assume that you used the first-in, first-out method.