Sahih Muslim 2679 b
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
لاَ يَقُولَنَّ أَحَدُكُمُ اللَّهُمَّ اغْفِرْ لِي إِنْ شِئْتَ اللَّهُمَّ ارْحَمْنِي إِنْ شِئْتَ . لِيَعْزِمْ فِي الدُّعَاءِ فَإِنَّ اللَّهَ صَانِعٌ مَا شَاءَ لاَ مُكْرِهَ لَهُ "
Abu Huraira reported Allah's Messenger (ﷺ) as saying:
None of you should say to Allah (like this): O Allah, grant me mercy, if you so likest. The supplication (of his) should (be permeated with) conviction (that it would be accepted by the Lord), for Allah is the Doer of (everything) He likes to do, and there is none to force Him (to do or not to do this or that).
Full reference and source
Sahih Muslim 2679 b In-book : Book 48, Hadith 9 USC-MSA web (English) : Book 35, Hadith 6479 (deprecated)
View source on Sunnah.com (opens in a new tab)