Of course the best way of getting out of the problem of reactivating old ships that should have be scrapped years ago, or to keep them in layup in the first place, is to not get into any more wars.
How to do that? By not provoking or attacking any foreign countries.
US has more weapons, warships and planes and spend more money on their military and intelligence services than the 10-12 next countries in the world.combined.
No major power is dumb enough to attack US mainland, or any US bases, unless they are attacked first, or severely provoked, because that is inviting their own demise.