The Messenger of Allah ﷺ said, "None of you should say, 'Allah, forgive me if You wish,' or 'Allah, have mercy on me if You wish.' Rather, let him be firm in his request, for nothing can compel Him."
حدثنا الأنصاري حدثنا معن حدثنا مالك عن أبي الزناد عن الأعرج
أن رسول الله ﷺ قال لا يقول أحدكم اللهم اغفر لي إن شئت اللهم ارحمني إن شئت ليعزم المسألة فإنه لا مكره له
Bukhari also narrated it in the Book of Supplications, chapter "Let one be firm in asking, for there is no one to force Allah," hadith no. 6339, from the hadith of Malik with the same chain, and it is found in Muwatta, 1/213.