That depends on the constitution of the country of the president in question and as you have not told us that we can not give you an exact answer.
In the US the vice president would take over first.
The vice President,Speaker of the house, and the Pro Tempore
the vice president
Next in line is the Vice President, followed by the Speaker of the House.
The Secretary of State is next in line after the Vice President.
Next in line after the VP is the Speaker of the House.
Vice President Speaker of the House president pro tempore of the Senate Vice President, Speaker of the House, president pro tempore of the Senate
The Vice President, Joe Biden, is next in line for President.
The next person in line is the Speaker of the House.
Next in line is the Vice-President, followed by the Speaker of the House.
Next in line is the Vice-President, followed by the Speaker of the House.
If the PRresident dies the Vice President is next in line. If the Vice President dies also the Secerectary of State takes over.
No one is next to die. The speaker of the house of representatives becomes the second in line to the presidency.