On the passing away of Sāriputta, the Buddha advises Ānanda to be an island unto himself, with no other refuge, with the Dhamma as his island, with the Dhamma as his refuge, not dependent on another as a refuge.

Cunda sutta - Cunda

At one time, the Blessed One was dwelling in Sāvatthi, in Jeta's Grove, Anāthapiṇḍika's park. At that time, the Venerable Sāriputta was dwelling in the village of Nālaka in Magadha, and he was sick, experiencing pain, and gravely ill. Cunda, the novice monk, was an attendant of the Venerable Sāriputta.

Then the Venerable Sāriputta attained final Nibbāna from that very illness. Then Cunda, the novice monk, having taken the alms-bowl and robe of the Venerable Sāriputta, went to Sāvatthi, to the Jeta's Grove, Anāthapiṇḍika's park, to where the Venerable Ānanda was. Having approached, he paid respects to the Venerable Ānanda and sat down to one side. Sitting to one side, Cunda, the novice monk, said to the Venerable Ānanda:

"Venerable sir, Sāriputta has attained final Nibbāna. This is his alms-bowl and robe."

"Friend Cunda, this topic should be brought up with the Blessed One. Come, let us go to him and report it."

"Yes, venerable sir," Cunda, the novice monk, replied to the Venerable Ānanda.

Then the Venerable Ānanda and Cunda, the novice monk, approached the Blessed One. Having approached, they paid respects to the Blessed One and sat down to one side. Sitting to one side, the Venerable Ānanda said to the Blessed One:

"Venerable sir, this novice monk Cunda said: 'Venerable sir, Sāriputta has attained final Nibbāna; this is his alms-bowl and robe.' Moreover, venerable sir, I feel as if my body is intoxicated, the directions seem unclear to me, and the teachings do not spring to mind after hearing that 'the Venerable Sāriputta has attained final Nibbāna.'"

Why, Ānanda, when Sāriputta attained final Nibbāna, did he take away your aggregate of virtue, your aggregate of collectedness, your aggregate of wisdom, your aggregate of liberation, or your aggregate of the knowledge and vision of liberation?"

"No, venerable sir, he did not take my aggregate of virtue, or my aggregate of concentration, or my aggregate of wisdom, or my aggregate of liberation, or my aggregate of knowledge and vision of liberation. However, venerable sir, the Venerable Sāriputta was an advisor, one who instilled understanding, explained, demonstrated, encouraged, inspired, and uplifted. He was tireless in teaching the Dhamma and supportive to fellow practitioners. We remember the essence of the Dhamma, the wealth of the Dhamma, and the support of the Dhamma given by the Venerable Sāriputta."

"But have I not already declared, Ānanda, that we must be parted, separated, and severed from all who are dear and agreeable to us? How, Ānanda, can it be obtained: 'May what is born, come to be, conditioned, and subject to disintegration not disintegrate!'? That is impossible.

Just as, Ānanda, a great tree standing sound and possessing heartwood might have its largest branch break off, so too, Ānanda, in the great community of bhikkhus standing sound and possessing heartwood, Sāriputta has attained final Nibbāna.

How, Ānanda, can it be obtained here: 'May what is born, come to be, conditioned, and subject to disintegration not disintegrate!'? That is impossible.

Therefore, Ānanda, dwell with yourselves as your own island, with yourselves as your own refuge, with no other refuge; dwell with the Dhamma as your island, with the Dhamma as your refuge, with no other refuge.

And how, Ānanda, does a bhikkhu dwell as an island unto himself, with himself as his refuge, not dependent on another as a refuge, with the Dhamma as his island, with the Dhamma as his refuge, not dependent on another as a refuge? Here, Ānanda, a bhikkhu dwells observing the body in and of itself, with continuous effort, fully aware, and fully present, having removed craving and displeasure with regard to the world. Similarly, he dwells observing feelings in and of themselves, the mind in and of itself, and mental qualities in and of themselves, with continuous effort, full awareness, and fully present, having removed craving and displeasure with regard to the world.

This is how, Ānanda, a bhikkhu dwells as an island unto himself, with himself as his refuge, not dependent on another as a refuge, with the Dhamma as his island, with the Dhamma as his refuge, not dependent on another as a refuge.

Whoever, Ānanda, now or after my passing, dwells as an island unto themselves, with themselves as their own refuge, not dependent on another as a refuge; with the Dhamma as their island, with the Dhamma as their refuge, not dependent on another as a refuge; they, Ānanda, will be the foremost of those who are keen on the training."