Two things – as per everyone except one above it is far better to keep an older car running (even if exhaust emissions are a bit high when it’s engine is cold) than it is to scrap it, mine and refine all the raw materials for a new one, especially electric (just google lithium mining!) ship said material half way around the world, build a new car in a factory powered by yet more fossil fuels then ship the finished product halfway around the world again and gain what, 5mpg?
Main point which may help the OP – my old petrol Hyundai failed the MOT on emissions a few years ago, a bottle of Redex in the tank and it sailed through the retest. It’s also a faily easy job to clean out the air intakes and filter and that will help, no mechanical skill required at all (do petrols have an EGR? The one on my current Transit was filing the intakes with tar and soot, ran much better when cleaned out, EGR now blanked off and that’s passed every emissions test with flying colours, although has mostly failed the MOT on rust…)