All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and messenger.
It is from the Sunnah to offer condolences when someone dies and to advise patience and contentment with the decree of Allaah The Exalted. This can be done using any words that reach this goal but there is no doubt that the most excellent words are what the Messenger of Allaah, sallallaahu ‘alayhi wa sallam, said to his daughter when her son died: “Verily, to Allaah belongs what He took as to Him belongs what He gave. Everything has an appointed time so be patient and content.” [Al-Bukhari, Muslim and others]
There is no harm in using other words like: “May your reward be great” or “May Allaah The Almighty Improve your comfort and Forgive your deceased.” Then, if the one being consoled replies with a Du‘aa’ by saying: “May Allaah The Almighty Reward you” or something similar, it is good.
Allaah Knows best.