Specific identification is the most flexible method because it lets you harvest a loss from a high-basis lot while keeping a low-basis long-held position, or deliberately realise a long-term gain instead of a short-term one.
The instruction must be given to the broker no later than settlement and confirmed in writing, and most platforms provide a lot selection screen for this. Choosing after year end or changing the selection on your return to something the broker did not report will create a mismatch with form-1099-b.
Watch the interaction with the wash-sale-rule: selecting a loss lot does nothing for you if a replacement purchase inside the 61-day window defers the loss anyway.
General information for the United States only, not tax advice. Rules change and depend on your circumstances, so check with a qualified adviser before relying on it.
Related: cost-basis-methods, fifo-cost-basis, wash-sale-61-day-window, form-1099-b, capital-loss-carryover