Usually buying a new car that already went to a facelift is your best bet as it means it has been significantly long enough in the market to get most of its early gremlins known and sorted.
Having said that I would now only consider buying a new car if I can pay it in one installment. I once loaned a new car and I regretted it immediately. Car was good but the amount I paid each month would have been better spent/invested elsewhere. I now drive a 20y old car that I paid cash last year. I checked before buying what were the main failure point (CVT transmission if not maintained properly) and bought a car with all the invoices and documentation checking it had been maintained properly and had her CVT oil changed. I expected a few things to fix (audio speaker, shocks) and negociated taking those into account.
The car drive very well, is spatious and comfortable, I could afford replacing it if it died suddently. I would only consider a new car if I decided to go electric but gas price would need to multiply by 3 at the very least. I've seen people going EV then back to gas when they realized that after ~8 years of use their EV needed a battery replacement whose cost negated any saving on gas. I think battery price needs to go down for more EV adoption. Nobody wants to buy a second hand EV if it needs a usd10-15k for a new battery and an EV becomes pretty much unsellable at this point without a replaced battery.