As we try to create a new energy infrastructure we need to make sure that a significant number of the jobs created are located where the jobs being lost currently exist. This means that we need to place lots of jobs building wind turbines and making solar panels where currently there are a significant number of jobs in coal, oil, and fracking.
We should also try to produce jobs relating to battery technology where the auto industry currently makes internal combustion engines. Providing subsidies to the new industries based on whether companies do so would go a long way toward making this happen.
People who work as coal minors are in no position to sell their homes and move to where these jobs would otherwise be located. The same is true for people in lower income jobs in the oil and gas industies.
To make this approach work it would also be necessary to provide the job training required to make this work doable for the people who will need to be able to do these new jobs.