The current FIDE rules for calculating ratings are given here for standard play and here for rapid and blitz. As you can see your rating only changes when you play. If you stop playing your elo remains fixed. All that happens is that after 2 years of not playing rated chess you are marked as "inactive". When you die there will be some delay but eventually FIDE will remove your name from the rating list.
A good example of this is the profile of Gary Kasparov. You see from this that he is ranked 2nd in the world but 0 in the world for active players because he hasn't played standard chess since 2005.
If you look at his rating chart you see that his standard rating has remained unchanged since he last played in 2005, his rapid rating has remained unchanged since he last played in 2017 and his blitz rating has remained unchanged since he last played in 2022