Article II of the Constitution provides that the president may be removed from office for "treason, bribery, or other high crimes and misdemeanors" through impeachment and subsequent conviction. Article I gives the power of impeachment to a majority of the House of Representatives and conviction to two-thirds of the Senate. Two presidents, Andrew Johnson in 1868 and Bill Clinton in 1998, have been impeached. Neither was subsequently convicted by the Senate; however, Johnson was acquitted by just one vote.
By Act of Congress, the president may resign if his written resignation is delivered to the Secretary of State. The only president to resign was Richard Nixon, on August 9, 1974, facing articles of impeachment being reported on favorably by the House Judiciary Committee and probable subsequent Senate conviction.
If the office of President becomes vacant, whether through death, impeachment, or resignation of the sitting president, or through other means, the vice president immediately becomes president per Article II of the Constitution. More detail is prescribed in the 20th and 25th amendments, and other laws extend the line of succession further. Nine vice presidents have succeeded to the presidency, however, no officials further down the line have. The only president to be elected to neither the office of president nor that of vice president was Gerald Ford, who was appointed by Richard Nixon and confirmed after his vice president, Spiro Agnew, resigned in 1973. Nixon later resigned and Ford succeeded to the presidency. Ford was never subsequently elected.