Electrification could but won't prevent future crises. The root of the problem is people think we can transition from fossil fuels to electricity and renewables and still have the "normal" that was built on fossil fuels.
Not a single watt of renewable electricity has displaced any fossil fuels. We just added it to our energy mix. Fossil fuel use is at an all time high. The energy transition is not possible until displacement occurs. Displacement can't occur until growth stops. At my most optimistic, based on falling birth rates and aging populations, growth may end in 30 years or so, as a combination of consumption standards and population decline and some very handwavium that we don't keep inventing energy hungry new shit like AI and datacentres.
By the time this could happen, we're already looking at +4°C global average temperature. Energy won't be our only problem.