Eh. The solution to the ozone layer was to replace refrigerant A with refrigerant B. A 1:1 swap that required very little effort from anybody.
Getting off fossil fuels more or less mandates an entire global paradigm shift in how we do basically everything. The entire global economy of the past 200 years has been built off an unsustainable energy source.
Sure, we can replace gas with batteries, but every step of the way is going to require small changes in how people do things, and they're going to be very resistant to that.
I'm somewhat pessimistic. Even if humans zeroed every single pollution, it won't be free on us, there's a bill to be paid, and Mother Nature will effectively charge us for this debt. And it'll not be cheap.