There was a rider attached to one of the latest appropriations bills (which is now law) that restricts how future Presidents can pull the US out of NATO. It can’t happen now unless Congress passes an act authorizing the President to do so, or with a 2/3 vote of the Senate (the same mechanism as ratifying a treaty).
So at least on this issue, we’ve put in some safeguards in case we elect an idiot again.