The vice president and a majority of the cabinet must first declare that the president is unable to fulfill their responsibilities. If that happens, the vice president immediately assumes power.
The president can then contest this decision by formally stating they are capable of continuing. At that point, the vice president and cabinet have four days to respond.