Is it authentically reported that the Prophet, sallallaahu ‘alayhi wa sallam, said that whoever expects goodness will get it?
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 'alyhi wa sallam, is His slave and Messenger.
We did not find any Prophetic Hadeeth (narration) with this wording. However, it was narrated on the authority of Abu Hurayrah that the Prophet, sallallaahu ‘alayhi wa sallam, forbade us from pessimism and encouraged us to say good encouraging words. [Al-Bukhari and Muslim] It was also narrated on the authority of Abu Hurayrah that the Messenger of Allaah, sallallaahu ‘alayhi wa sallam, liked optimism and detested pessimism. [Ahmad in his Musnad and Sunan Ibn Maajah]
Al-Haafith Ibn Hajar mentioned that the Prophet, sallallaahu ‘alayhi wa sallam, liked good, encouraging words because displaying pessimism is considered mistrust of Allaah The Almighty for no reason. On the contrary, optimism signifies trust in Allaah The Almighty. Indeed, believers are commanded to trust in Allaah The Almighty and think well of Him in all cases and situations.
Optimism was represented in many acts of the Prophet, sallallaahu ‘alayhi wa sallam. For example, he used to love good auspicious names, and used to start from the right side and move on to the left in everything, because the Companions of the right are the people of Paradise. All of this was part of trusting in Allaah The Almighty and thinking well of Him, as we are commanded, according to the Sharee’ah (Islamic law).
In a Qudsi Hadeeth (sacred narration) narrated on the authority of Abu Hurayrah Allaah The Almighty Says, that as long as the slave thinks well of Him and utilizes the available means to achieve his goal, including repentance, thanking Allaah The Almighty, and being satisfied with all that Allaah The Almighty brings him, He will guide him to what is right and good. [Al-Bukhari and Muslim]
Allaah Knows best.
You can search for fatwa through many choices