All these situations may lead to the replacement of the leader by the next commander in the line of succession, as written in the constitution.
The death of the president, a process of impeachment or resignation lead to the post of the country's leader the vice president. This is a way of ensuring that the nation does not run out of a commander in case of a fatality or a lawsuit. Virtually all democracies have this guarantee mechanism.
Moreover, such a situation can cause turbulence in politics as it moves across the entire command line of a country. If someone else takes office, anything can change.