If they die after winning but pre-electoral college: electors pick.
If they die after the electors vote: then standard succession rules apply.
The Electoral College, but the members are not, in quite a few states, free to vote other than as directed by law, and in 14 states their votes are actually cancelled if they vote for any but the pledged candidate.
Actually, that's determined by state law and, as such, may be so where you live, but not everywhere[0].
[0] https://www.forbes.com/sites/danielcassady/2020/09/05/electi...
If they die in time for whatever the ballot cutoff is in each state, the parties can select a replacement, but I'm pretty sure that time has passed (it must have where ballots are already being cast); they may do so later, but this will have different effects in different states.
After the people have voted (even before the electors cast their ballots) faithless elector laws come into play, and 14 states cancel votes of electors that do not cast their votes for the pledged candidate, and AFAIK none of those 14 states have post-popular-vote change of pledge rules. Conceivably, electors in the other states could change their votes (some with some penalties, but not vote cancellation), whether or not the party directed them one particular way before or after the people voted. But any votes that are out of line with the outcome of the state vote, even if by reason of the elector choosing an alternate because of candidate death, are outside of the safe harbor law (which is probably not enforceable, but that just means other votes within the safe harbor could in theory also be at risk) and potentially subject to challenge and potential cancellation when Congress counts the electoral votes. Congress may, in this case, also accept offered competing electoral votes, if such exist.
But if no candidate receives the required majority of available (not tallied) electoral votes for either President of VP (or both) as judged by Congress, the succession rules for that office come into play when the term starts with the office vacant.
Are those states required to prosecute based on those laws?
https://electionlawblog.org/?p=116098
As I pretty much expected: the parties would quickly nominate new candidates, and then scramble to get them on ballots despite being past normal deadlines. Courts would probably have to get involved. Does not address what would happen to votes already cast.
That's apparently an excellent question. Fortunately, there's a discussion here[0] about it.
I know this because dsr12[1] helpfully submitted it here on HN[2].
It's an interesting article and I will go over to the discussion page shortly, as it already has a bunch of comments.
[0] https://electionlawblog.org/?p=116098
"With News That the President Has Tested Positive for Coronavirus (and He Was in Contact with Joe Biden at the Debate Earlier in the Week), What Happens If a Presidential Candidate Dies or is Incapacitated Before Election Day? A Mess"