The Messenger of Allah ﷺ said, "None of you should say, 'Allah, forgive me if You wish. Allah, have mercy on me if You wish.' Rather, let him be firm in his request, for nothing can compel Him."
حدثنا القعنبي عن مالك عن أبي الزناد عن الأعرج
أن رسول الله ﷺ قال لا يقولن أحدكم اللهم اغفر لي إن شئت اللهم ارحمني إن شئت ليعزم المسألة فإنه لا مكره له
Bukhari included it in the Book of Supplications, Chapter, Let one be firm in asking, for none can compel Him, hadith 6339, from Qanabi, and it is found in the Muwatta (Yahya's version) 1/213, (Ibn Qasim), hadith 336, and Abu Musab Zuhri, hadith 617.