I'm completely ignorant to the US political system, but what would happen if a candidate were to pull out due to health reasons?
https://ballotpedia.org/State_laws_and_party_rules_on_replacing_a_presidential_nominee
Ballot rules:
The bulk of the dates for certifying the names of major party presidential candidates are in August and September. The Democratic and Republican parties, then, would have until about mid August to find a replacement nominee and still be able to get his or her name on the ballot in enough states to be competitive in November. For example, if a nominee dropped out in late August, his or her name would already be certified to appear as their party's candidate for president in about 20 states. If he or she dropped out in late September, that number rises to almost 40 states.
DNC rules:
The procedures that the Democratic National Committee (DNC) would follow if the Democratic presidential nominee Hillary Clinton dropped out of the race are a bit simpler than the RNC's. The chair of the DNC is to call a meeting, and the DNC holds the authority to elect a replacement nominee by majority vote.
Article 2, section 1 of the Rules and Bylaws of the Democratic Party states that the DNC has the authority to fill vacancies in the nominations for president and vice president. "The Democratic National Committee shall have general responsibility for the affairs of the Democratic Party between National Conventions, subject to the provisions of the Charter and to the resolutions or other official actions of the National Convention. This responsibility shall include, but not be limited to ... Filling vacancies in the nominations for the office of the President and Vice President," reads Article 2.1(c).
Article 2, section 7 states, " a special meeting to fill a vacancy on the National ticket shall be held on the call of the Chairperson, who shall set the date for such meeting in accordance with the procedural rules provided for in Article Two, Section 8(d) of these Bylaws." Article 2, section 8(d) reads, "all questions before the Democratic National Committee shall be determined by majority vote of those members present and voting in person or by proxy."