In general, it’s preferable to avoid taking out loans if you’re able to get what you need with available cash. You save on the interest. Why take on debt when you don’t need it?
The exception to this is when interest rates are very low. In that case, the money you save on interest by paying cash is small. In addition, you are limited to whatever car you can afford with your own money. This may mean buying an older used car, or a new car without all the features you would prefer to have. And lastly, your cash is gone. So if you have an unexpected expense, you have to find another way to pay for it. If you have an attractive investment opportunity, you won’t be able to take advantage of it.
Financial advisers usually counsel against borrowing for anything that is expected to depreciate (decline in value). Cars depreciate, so over a period of years, you are paying for something that will be worth less than when you bought it.
But in the longer run, taking out a loan at a low interest rate (at the time of this writing, rates are at historic lows) allows you to buy a better, more reliable car that may also be more fun to drive. And that matters when you own a car for many years.