According to the 25th Amendment of the United States Constitution, if the President of the US dies in office or must leave office before the term expires, the following process takes place:
1. The Vice President takes the oath of office as President.
2. The newly appointed President can then nominate a new Vice President, who must be approved by Congress.
This process ensures a smooth transition of power in the event of the President's death or resignation, maintaining the continuity of leadership within the government. The 25th Amendment outlines clear steps to follow in such scenarios to ensure stability and adherence to the constitutional framework.