John Ashcroft lost to a guy who died when he ran for a senate seat in 2000. The governor replaced him with his widow.
That wasn’t a presidential election so not sure what would happen.
Remember, we are not voting directly for a president or vice president. We are voting for the electors chosen by the party. If a candidate dies, the DNC or RNC will select a replacement and the electors will cast their votes for that person.