This answer depends on your Loan Types.
If you already have Direct Loans, you do not need to consolidate in order to become eligible. The Federal Student Aid Office simply requires that your loan(s) be non-defaulted Direct Loans for PSLF (unless you have Direct Parent Plus loans).
If you do not have Direct Loans, you may have received loans under other federal student loan programs, such as the Federal Family Education Loan (FFEL) Program or the Federal Perkins Loan (Perkins Loan) Program. Loans from these programs do not qualify for PSLF, but they may become eligible if you consolidate them into a Direct Consolidation Loan.
Under the old rules, when you consolidated your payment count reset to zero and you needed to make 120 more payments. However, new rules help you get credit for these past payments, and you can learn more here.
For more information, visit https://studentaid.ed.gov/sa/repay-loans/forgiveness