Also, most people (used to) buy a new car every 5 years. The logic is they want a newer car to avoid paying for repairs, and as long as you're going to be making a monthly payment anyways, might as well get a new one.
For a cost/benefit analysis I recommend a 6-10 year-old economy car (one with a record of reliability) with a manual transmission, pay it off quickly so no monthly payment. Then...keep it a very long time. Towards this end, I have a 1991 Toyota 4-cyl truck that just barely passed over 100K miles.
By moving closer to your work and buying a well-engineered E-bike, you can cut out 80% of you car miles, and 95% of the miles you used to rack up when you lived a longer drive away. Its not just saving on gasoline costs (which will go up again) but whatever car you have, it will last MUCH longer and will have higher resale value due to lower miles at sell-time.
With low accumulation of miles, parts wearing out is pushed farther back, and time between problems (tires/brakes/minor repairs) is more spread out.
It wasn't raining when Noah started building the ark...