Seven steps, in the order the arithmetic puts them
Each step is placed by the certainty-adjusted return of the money that flows into it. That is why an employer match comes before clearing a credit card, and why a cash buffer comes before an index fund.