"Monks, be islands unto yourselves,[1] be your own refuge, having no other; let the Dhamma be an island and a refuge to you, having no other. Those who are islands unto themselves... should investigate to the very heart of things:[2] 'What is the source of sorrow, lamentation, pain, grief and despair? How do they arise?' [What is their origin?]
"Here, monks, the uninstructed worldling [continued as in SN 22.7.] Change occurs in this man's body, and it becomes different. On account of this change and difference, sorrow, lamentation, pain, grief and despair arise. [Similarly with 'feelings,' 'perceptions,' 'mental formations,' 'consciousness'].
"But seeing[3] the body's impermanence, its change-ability, its waning,[4] its ceasing, he says 'formerly as now, all bodies were impermanent and unsatisfactory, and subject to change.' Thus, seeing this as it really is, with perfect insight, he abandons all sorrow, lamentation, pain, grief and despair. He is not worried at their abandonment, but unworried lives at ease, and thus living at ease he is said to be 'assuredly delivered.'"[5] [Similarly with 'feelings,' 'perceptions,' 'mental formations,' 'consciousness'].
See also: DN 16.