Simply by developing the resources that exist in your own country.
So called "rare earth metals" that are used in magnets, and therefore everything, are produced mainly in China. Many suitable mining sites exist in the US, specifically in a shut down mine in California. These domestic sources can be exploited, all that is lacking is the political will to do so.
These domestic sources can be exploited, all that is lacking is the political will to do so.