It used to be the case you could get a new car and take out a loan with the car company for 0-1%, or buy a used car and get a loan with the bank for 5-6%. I don’t think the car companies are offering those deals now but when they did, for the same monthly payment you could get like a $20k new car or a $13k used car. Given the risk of inheriting someone else’s mechanical problems + you don’t know how well they took care of it, in that specific case new could be the better use of money in the long run.
I’ve helped a couple friends buy a car. I usually say either go with the very low end of new cars, or buy some 15 year old Honda or Toyota that will run reliably for a while longer for like $5k