There is nothing wrong in doing good deeds prior to du`a’. Also, a Muslim is advised to keep on making du`a’ and dhikr, for du`a’ is the essence of worship as stated in one of the Prophet’s hadiths.
Sheikh M. S. Al-Munajjid, a prominent Saudi Muslim lecturer and author, states: “Doing righteous deeds in the hope that du`a’ will be answered is something that is prescribed in Shari`ah. Hence performing wudu’ and praying in Al-Masjid Al-Haram may be included among righteous deeds that may be done before making du`a’ in the hope that the du`a’ will be answered.
It was narrated from ‘Uthman ibn Hunayf that a blind man came to the Prophet (peace and blessings be upon him) and said: Pray to Allah to heal me. He said, ‘If you wish, you may delay the reward until the Hereafter, and that is better, or if you wish, I will make du`a’ for you.’ He said, Make du`a’. So he (peace and blessings be upon him) told the man to perform wudu’ and do it well, and to pray two rak`ahs, and to say this du`a’: Allahumma inni as’aluka wa atawajjahu ilayka bi Muhammadin Nabi ar-rahmah. Ya Muhammad inni qad tawajjahtu bika ila rabbiy fi hajati hadhihi li tuqda Allahumma shaffi’hu fiyya (O Allah, I ask of You and I turn my face towards You by the virtue of Muhammad, the Prophet of Mercy. O Muhammad, I have turned my face by virtue of you to my Lord concerning this need of mine so that it may be met. O Allah, accept his intercession concerning me).‘ (Reported by At-Tirmidhi)
The above hadith indicates that prayer is one of the righteous deeds by virtue of which a person’s du`a’ may be more likely to be answered, and that it may be one of the causes of the du`a’ being accepted.
What has been said regarding prayer may also be said regarding fasting. The intention behind it should be to worship Allah by means of this great act of worship, and to attain the reward for it in the Hereafter, and to fear Allah and earn His pleasure. Then if he is fasting, it is recommended for the fasting person to make a great deal of du`a’, for the du`a’ of the fasting person will be answered, especially at the time of breaking the fast.”