The 25th Amendment of the US constitution is in the top of my mind. This deals with succession in the event of the resignation, death, or incapacity of POTUS. It also allows for temporary incapacity, during which the VP may step in as acting POTUS.
Several times the POTUS has died in office. One resigned. Grover Clevland was temporarily incapacitated during recovery from surgery. Has any previous POTUS been permanently removed due to incapacity?