The Buddha Gotama said, why do you think I could be a friend? Because I do not harm you. Gotama repeated what King Pasenadi Kosala and Queen Mallika Kosala taught. "Of all your friends, is there one who is dearer to you than yourself? In the same way, all others are dear to themselves. If you love yourself, you will not harm the selves of others." (Udana 5.1).
When Ananda said to the Buddha Gotama that he thought dear friendship was half the holy life, Gotama corrected him: "do not say that, Ananda. Do not say that! Friendship is the whole of holy life. When a person has dear friends, they may be expected to develop and pursue the noble eightfold path. They will develop right view on seclusion, become dependent upon dispassion and cessation, dependent on relinquishment. They will develop right resolve, right speech, right action, right livelihood, right effort, right mindfulness, right concentration. It is by My friendship that beings subject to birth have gained release from birth, beings subject to aging have gained release from aging, beings subject to death have gained release from death, beings subject to distress have gained release from distress. My friendship is no different than any other dear friendship." (Samyutta Nikaya 45.2)
What, then, is a dear friend? What is the self? A dear friend has seven qualities: a friend gives what is beautiful and difficult to give, a friend does what is hard to do and endures and forgives painful words from you, a friend endures what is hard to endure, a friend trusts you and keeps no secrets and valuables from you, you may trust a friend with your secrets and valuables too, when misfortune strikes a friend does not abandon you or look down upon you. (Anguttara Nikaya 7.35).
Separation from what is dear is distressing. And when King Pasenadi Kosala lost his dear friend, Queen Mallika Kosala, to death, the Buddha Gotama comforted him, saying, there is nothing accomplished by this distress, sorrowing or grieving except the gratification of your enemies. Remember your dignity: you are so close to attaining the goal. If you do not waiver now in the face of misfortune, you will pain your enemies. Now that you no longer have your friend, eulogize your friend, perform your family's customs and your duties - if you can see some gain in these acts. But if they do not accomplish your goal, ask yourself - as your friend would have - "what important work am I not doing right now?" Be a friend to yourself. Remember all that has a beginning must end. (Anguttara Nikaya 5.49)
And when the Buddha Gotama died, Ananda considered his duties, and whether any good would be accomplished by eulogizing his friend, or performing his family's customs. Having burned his cousin's body, as was the customs of their family, he remembered how the Buddha instructed in the worship of the directions. He was about to perform this ritual, but was overcome by grief. "Tonight, I cannot even tell which direction is which: I cannot tell what is up, or down, or north or south, east or west. None of the Buddha Gotama's teachings are clear. For one who is separated from their friend, no other friend seems to do. I long for my dear friend. All my dear friends, who I am separated from. All my old friends are now dead. I do not seem to fit in with these new and young friends I am surrounded by. So tonight I will remember Gotama alone, reflecting and musing like a bird who has gone to roost." Ananda paused as he reflected. "When He died, there was terror, my hair stood up on end! He was a virtuous, wise man - - - "
And then suddenly Ananada remembered how Gotama taught all things are impermanent. All things are always beginning and ending. He remembered all the teachings he had witnessed. He extinguished his self and becoming his own friend, became enlightened. Becoming enlightened, he perfected his wisdom, and became contented. After a long while, he spoke again to the assembly. "I had heard 82,000 teachings from the Buddha Gotama. And 2,000 more from his students. I have memorized and learned 84,000 lessons in total. Yet for all I heard I understood nothing until just now. I was like a blind man, holding a lamp." And then Ananda, inwardly collecting his mind, began to teach the 84,000 lessons he had learned. (Theragatha 17.3).