Easiest way to work out dead buttons is actually to ignore the button altogether - at least to start with.
The rule is intended to ensure that nobody misses their blind or is charged extra blinds. So what you do is always move the big blind one seat to the left. Get the big blind right and everything else just falls into place, as the small blind and the button just "follow" the big blind along and if they happen to fall on a seat that was vacated last hand, then there's a dead small blind or button.
The button and the small blind should never be in the same seat, unless you're playing heads-up.
In OP's example where the small blind gets knocked out on a hand, there's a dead button on the next hand. The player that was the big blind last hand is small blind this hand, and the player that was UTG last hand is the big blind this hand.
The player who was on the button last hand is the one that gets the advantage, because he/she effectively gets to be the button twice in a row.