In 1948, both houses of Congress passed a resolution stating that if the U.S. wanted to leave the organization, it would have to give one year’s notice and pay any outstanding funds.
The United Nations would create the 1969 Vienna Convention on the Law of Treaties and its 1986 extension to help countries withdraw from multilateral organizations should they choose to do so, but the U.S. never ratified these agreements, something that the Trump administration no doubt regrets now.
Was this withdrawal likely to happen? It was very hard to judge what Trump will do next as his decision making processes play more like experimental jazz than the London Philharmonic Orchestra. As alluded to before with the president’s thoughts on NATO, he does have a recent history of exiting organizations that have had long standing relationships with the U.S.