كتاب الذكر والدعاء والتوبة والاستغفار
48  
The Book Pertaining to the Remembrance of Allah, Supplication, Repentance and Seeking Forgiveness
(3)
Chapter: Being Firm In Supplication And Not Saying: "If You Will"
(3)
باب الْعَزْمِ بِالدُّعَاءِ وَلاَ يَقُلْ إِنْ شِئْتَ
Sahih Muslim 2679 b

Abu Huraira reported Allah's Messenger (ﷺ) as saying:

None of you should say to Allah (like this): O Allah, grant me mercy, if thou 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).
حَدَّثَنَا إِسْحَاقُ بْنُ مُوسَى الأَنْصَارِيُّ، حَدَّثَنَا أَنَسُ بْنُ عِيَاضٍ، حَدَّثَنَا الْحَارِثُ، - وَهُوَ ابْنُ عَبْدِ الرَّحْمَنِ بْنِ أَبِي ذُبَابٍ - عَنْ عَطَاءِ بْنِ مِينَاءَ، عَنْ أَبِي هُرَيْرَةَ، قَالَ قَالَ النَّبِيُّ صلى الله عليه وسلم ‏ "‏ لاَ يَقُولَنَّ أَحَدُكُمُ اللَّهُمَّ اغْفِرْ لِي إِنْ شِئْتَ اللَّهُمَّ ارْحَمْنِي إِنْ شِئْتَ ‏.‏ لِيَعْزِمْ فِي الدُّعَاءِ فَإِنَّ اللَّهَ صَانِعٌ مَا شَاءَ لاَ مُكْرِهَ لَهُ ‏"‏ ‏.‏
Reference : Sahih Muslim 2679b
In-book reference : Book 48, Hadith 9
USC-MSA web (English) reference : Book 35, Hadith 6479
  (deprecated numbering scheme)