When the Prophet (upon him be peace) and Abū Bakr were in the cave the polytheists came searching for them. Abū Bakr saw their feet and mentioned that if they would look down, they would see the two of them there. The Prophet’s response to him is mentioned in the Qurʾān:
إِذْ يَقُولُ لِصَاحِبِهِ لا تَحْزَنْ إِنَّ اللَّهَ مَعَنَا
“When he said to his companion: ‘Do not worry. Verily, Allāh is with us!’”
Regarding this is has been said:
مِنْ حَقِّ الصُّحْبَةِ تَخْفِيفُ الْأَحْزَانِ
“From the rights of companionship is alleviating another’s sadness and worry.”
 Q, 9:40.