Researchers from Eastern Washington University and Hofstra University in the Journal of Positive Psychology discovered that "people who simply wrote about death in a more abstract way didn’t feel any more grateful afterward; the people who just imagined a day in their life seemed very slightly less grateful. But the gratitude scores of people who actually visualized their own deaths skyrocketed. These people seemed deeply affected by confronting their own mortality 'in a vivid and specific way.'"
But this isn't advice that you should think about your death all the time. The researchers found that even just imagining something you value being taken away from you heightens your appreciation for that thing. In essence, you can get the same benefits by thinking of things for which you are grateful or said another way - keep a gratitude journal.