This is the default method to figure shares you sold if both of these apply:
You held your shares in a brokerage account.
You didn't specify a method when you sold your shares.
With the first-in, first-out method, the shares you sell are the first ones you bought. Since the market usually goes up over time, you'll get a bigger gain by selling shares you bought using the first-in, first-out method. You might have held the shares for various lengths of time. If so, you might get favorable long-term capital gains treatment by selling the shares you bought first.
If you want to sell shares other than these, you must identify the shares in writing before the sale. The broker must also send you a confirmation that those shares will be sold.