Doç. Dr. Murat Kaya recounts the prayer recited by our Prophet (PBUH) when saying farewell to someone.
Our Prophet sallallahu aleyhi ve sellem would recite this meaningful supplication when bidding farewell to someone:
أَسْتَوْدِعُ اللّٰهَ دِينَكَ، وَأَمَانَتَكَ، وَخَوَاتِيمَ عَمَلِكَ
“I entrust you to Allah for the protection of your religion, the fulfillment of your trusts, and the good ending of your deeds.” (Tirmidhi, Du’a 44. Also see Abu Dawud, Jihad 73; Ibn Majah, Jihad 24).

