The sweet spot has always been a 1 year old used car with low miles. There’s lots of those for less than or about $25k. Honda, Toyota, and Mazda have models in those ranges that will easily last a decade.
I've bought a couple of those and never again. They're usually former rental cars and people best the shit out of them. I've had so many stupid things break