There is case where one develops perception of death, in short;
Life is uncertain death is certain
I may die in 100 years... in 1 year... in a month... in a week... in a day... in an hour... on the in or out breath.
The dying on the in & out breath is the one bringing about most urgency.
Furthermore before going to sleep and after waking one contemplates;
In many ways can death come to me, proceeding to contemplate causes
having contemplated the various causes, one reviews;
Are there any bad qualities in the mind that would lead to my detriment if i was to die during the night or to die during the day?
If there are such bad qualities one resolves on working to elimimate them asap.
This would be kind of planning for future.
Refer to maranasati sutta 1&2. Thereis also a Sutta where the Buddha talks about how short the human life is in terms of how many seasons, days, nights and meals, it is a good one. Don't recall the title of the latter.
The way i do it is by starting with the general shortness of human life and then narrow it down to in and out breath. I also do the other morning/evening contemplation and the reviewing of mind.
One who develops perception of death is getting a lot of motivation & urgency to train and the priorities are straightened up.
It is also tied up with perception of impermanence and parting. These also have good results as they establish these inclinations in mind, distancing from the perception of attractiveness and reliability.
I usually get an affinity for that theme and am not much distracted. If i am distracted i change to something that i think will calm it down.