The Messenger of Allah ﷺ said, "None of you should say, 'Allah, forgive me if You wish, have mercy on me if You wish, provide for me if You wish.' Let him be firm and resolute in his request, for Allah does whatever He wills and no one can compel Him."
وقال رسول الله ﷺ لا يقل أحدكم اللهم اغفر لي إن شئت وارحمني إن شئت وارزقني ليعزم المسألة إنه يفعل ما شاء لا مكره له
A sahih hadith, narrated by Bukhari, volume 9, page 140. It was also narrated by Muslim in the Book of Supplications, from Ishaq bin Musa, with the wording, "None of you should say, 'O Allah, forgive me if You will.'" It was also narrated by Ibn Majah in the Book of Supplications, from Abu Bakr.The meaning of the hadith is that it is recommended to be firm and decisive in one's requests, and it is disliked to make them conditional on Allah's will. The scholars said the reason this is disliked is that conditioning something on someone's will is only meaningful when dealing with someone who might be compelled or forced, and Allah is far above that. It has also been said that the reason for the dislike is that this expression carries the appearance of not really needing what is being requested, or of not needing the One from whom it is requested.