The First In First Out method is referred to as FIFO. It is a straight- forward concept--the first shares you bought are always the first shares you sell. The IRS likes this method because in a generally rising stock market, it maximizes the capital gain tax that they will collect.
Absent any action on your part, this is the method that brokerage firms will apply when you sell a stock that has multiple tax lots. (It applies to bonds, too, but usually the difference in cost between bond tax lots is minor, unlike stocks which can vary substantially over time.)
To take control of your own tax destiny, we highly recommend that you use the Specific Identification method instead. You don't want to pay capital gains tax on the shares that your Aunt Mabel gave you back in 1960 (with a carryover basis of $1.00 per share) when you have reinvested dividends for years and now find that you need to sell a little bit. Why pay capital gains tax on decades of inflation when with a little effort you can minimize your tax by specifically identifying your recent dividend reinvestment shares as the ones you are selling?