The date was originally set at 2040, but Britain's Prime Minister has amended the time frame after being warned by experts that they need to act sooner if the country wants to have any chance of becoming virtually carbon free by 2050.
He said that this year would be a "defining year of climate action".
Broadcaster and natural historian Sir David Attenborough said at the launch of the COP26 summit at London's Science Museum that it's "encouraging" to hear the government's plans.
He added: "The longer we leave it ... the worse it is going to get.
"So now is the moment. It is up to us to organize the nations of the world to do something about it."
The ban would mean people will only be able to buy and sell electric or hydrogen vehicles.