You stated the proper balance:
1- On the one hand, let death deter you from sins and from being materialistic.
2- On the other hand, see death as a graduation for you if you are prepared. As long as you have faith in Allah, you follow the Qur’an and the Ahlulbayt, and you are trying your best to keep away from sins, then see death as victory, as going back to Allah and as experiencing the mercy of Allah to a greater extent.