Yeah I think filing deadlines for a good amount of states have passed at this point. Not fully sure if someone could replace Trump (or Biden) on the ticket at this point. That's not even thinking about the fact that TONS of people have already voted by mail, and those votes can not be changed even if the candidate has died or has become incapacitated in some way up to this point.
I suppose Congress could delay the election, but we're too deadlocked to even let that happen. You'd need both sides of congress to agree on that, and the GOP controls the Senate while the DNC controls the House.
In summary: If one of them dies, the other will most likely win and that'll be the end of the election.
IMO if either Trump or Biden drops out of the race, their party will likely try to prevent the other side from being able get 270 electorial college votes so that Congress will get to decide who becomes President for the next term.
If Congress decides the next election, each state will get to cast one vote, based on their delegation at the next congress. Currently Republicans have at least 26 votes, and it is unclear how many Democrats would have.
I would expect Democrats to try to hold up state elections in court through when the electrical college must meet according to the constitution. They will also likely try to hold up congressional elections in states of which would vote Republican based on their delegation.
If Congress cannot decide who will become the next President, it will be as if both the President and Vice President died, and whoever is in line after the VP to become President will become President. According to statute, this would be Speak of the House, Nancy Pelosi, then Senator Chuck Grassley, then Secretary of State Mike Pompeo (it doesn't matter after this point). The Constitution says that no person can be both President and a member of the legleslative branch (a congressmen or Senator) at the same time, so in order for Pelosi or Grassley to be eligible to be president, they would need to resign from Congress/Senate, however if they resign from the legleslature, they would no longer hold the position that makes them to be in line to be President per statute. This means Secretary of State Mike Pompeo has a decent chance of being President early next year.