These words are traditionally said to be the last that the Buddha uttered to an audience of Arahants, just before he passed into parinibbāna. The source text is chapter six of the Mahāparinibbāna Sutta (Dīgha Nikāya 16.6.8).
va ya dha mmā saṃ khā rā
a ppa mā de na saṃ pa de thā
Conditioned things are perishable;
with vigilance strive to succeed.
I have written full length commentary on the Buddha's Last Words which is now on my website: jayarava.org/buddhas-last-words.html. I've also written a shorter gloss focusing on the word appamāda on my blog: see The Last Words of the Buddha