Twenty-fifth Amendment to the United States Constitution
This means that if the President is fired, dies, resigns, or is unable "to discharge [their] Powers and Duties" (unable to do the things a President has to do), the Vice President will take over their job.  The Vice President will do the President's job until they get better (if they are just sick or disabled), or until the next Presidential election (if the President resigned or is dead).  If neither the President nor the Vice President can do the President's job, Congress can decide who takes over the President's job.  This is all the Constitution says about this subject.