Interest rates are way too low to pay all cash up front. My car loan's rate is 2.15% - on a USED car. If your income allows you to fund a ROTH IRA, max it out now and in January (for 2022). That would be about $13,000. invest the bulk of the money in monthly dividend payors at a much higher rate than your car loan. You'll come out on top.
OR, simply keep the cash and pay the car note from your paychecks.