How long should a car last? years vs miles

thank you! very helpful. I do stay on top of maintenance. Car has no personal value so I would never make a sentimental decision over an economic one. I just wanted to make sure that I’m not wasting my money on repairs.