It doesn't take much driving for a new EV to balance out the environmental cost of harvesting, shipping, pumping, and burning all that petrol. As I understand it, about 20k km or 15k miles, on average.
This is comparing BUYING a new gas car to BUYING a new electric car.
I already have the gas car from 8 years ago.
From what I can tell keeping this is way better than buying any new car - of course if I do buy a new one it’ll be electric. But keeping an existing car uses way less co2 than buying a new one.
The markets for EVs and gas cars are fairly established, so your personal choice to keep fixing your car vs selling it to someone else who will fix it instead doesn't have a net change on the environment. Nor does your choice to buy a new car or a used car.
The only thing that matters, really, is whether you are personally supporting the oil market or the electric market, how much, whether electric generation in your area has a good mix of green sources, and your support for political willingness to embrace policy that identifies and prices-in the side-effects on the environment, such as eliminating subsidies for oil companies. It all boils down to your willingness to put your money where your beliefs are, which for some people is very hard to do, for some people is not very hard to do, and for some people the environment just doesn't factor into their decision making at all. Tragedy of the commons, or will enough people actually care? Those who have the means and the awareness, definitely should.
It is still less environmental damage to keep an old vehicle on the road and not create a new one. Some cars can literally last forever (these models are well known) if they are looked after.
The scrap yards are btw filling up with modern cars quite quickly because people cannot afford to repair new cars, or the cars are uneconomical to repair even after minor collisions. Whereas a lot of old cars (pre-2010) can be fixed on your driveway with easily affordable tools.