It is not at all clear how to alleviate the problems caused by globalization. If it were clear how to do this, countries would already have taken steps and globalization would not cause as many problems as it does. The approach that seems to make the most sense is to provide education and training for the workforce in each country.
Education and training are important for the people who have been harmed by globalization. For example, in the US, many people have been harmed by globalization when their jobs have been sent overseas to places where labor is cheaper. Such people could potentially be helped by giving them government-funded training for jobs that do exist in the US. Education and training are important for young people in various countries. Education and training will allow them to be better qualified to fill various kinds of jobs. Education, in particular can bring about a situation where more people in developing countries can start businesses that will be able to diversify their economies.
All of this is much easier to say than to actually implement. We have not yet found fool-proof ways to alleviate the problems caused by globalization.