Just as a hug can reassure another human that "everything's going to be ok," gentle touches and trunk strokes can carry the same message between elephants.
Elephants are extremely social creatures that establish strong bonds with each other. They fiercely protect babies and mourn their dead, so it's not too shocking to find that they also console one another, too.
Elephants signal distress by pointing their ears forward, sticking their tails out erect, and letting out a low-frequency rumble, trumpet, or roar.
Whenever one of the elephants go through a stressful situation and demonstrated signs of distress other elephants would come over and give the distressed elephant a gentle pat. The “friends” also would often also make a "high-pitched chirping sound," similar to the warm tone a human might take to show a startled child that everything is ok through these vocalizations and gentle touches.
In other words, seeing a "friend" in distress was distressing to observers. Those animals also consoled one another by taking on the emotional state of their companion.
This phenomenon is known as "emotional contagion," which is thought to be linked to empathy. If you've ever cried while watching a tear-jerker movie, you've experienced emotional contagion.