According to the U.S. order of succession, if both the president and the vice president are, for whatever reason, unable to serve, then the Speaker of the House of Representatives becomes acting president. If he/she also cannot serve, the next individuals in line are the President pro tempore of the Senate and then the Secretary of State.
Secretary of State
the speaker of the house
Vice Pres
Speaker of the house
Secretary of state.
Sec. of State
The Speaker of the House of Representatives.
vice president until presidents term is up.
Vice president
The new president gets to choose but the senate has to confirm.
The Vice President will take the immediately responsibility.
Next in line is the Speaker of the House of Representatives.