Another scenario to consider:
President Biden wins the Democratic nomination, but subsequently either dies or becomes incapacitated. With the 25th amendment being invoked, Vice-President Kamala Harris becomes the nominee in time for the Democratic National Convention, and wins the election on a mix of the sympathy vote and on the back of Biden's accomplishments in his term in office. Seems a lot more likely than having him resign or being impeached for being too old (
).
This is not how the Democratic National Committee chooses its nominees - or at least was not
at the time of the 2020 Convention (I have not been able to find the corresponding document for 2024, if it exists at all).
If a prospective nominee cannot discharge their duties sufficiently, pledged delegates shall vote on the first ballot as normal anyway, but "shall in all good conscience reflect the sentiments of those who elected them." It is likely for this obvious reason that Harris would be nominated instead in such an event.
If an actual nominee cannot do so, the chair of the DNC is always to meet with Congressional and Democratic Governors Conference leadership, report to the DNC at-large, and authorise them to select some other nominee.