Those are questions without settled answers. There are procedures that cover some of these contingencies, but they depend on the goodwill of a small group of people, and will likely not result in the public getting a shot at actually choosing their replacements.
And the likelihood that whatever happens will be litigated in a biased court is high.
https://www.theguardian.com/us-news/article/2024/may/05/what-happens-presidential-candidate-trump-biden-dies