Surah Al-Baqarah (البقرة) · verse 251 (Medinan · Juz 2 · page 41)
فَهَزَمُوهُم بِإِذْنِ ٱللَّهِ وَقَتَلَ دَاوُۥدُ جَالُوتَ وَءَاتَىٰهُ ٱللَّهُ ٱلْمُلْكَ وَٱلْحِكْمَةَ وَعَلَّمَهُۥ مِمَّا يَشَآءُ وَلَوْلَا دَفْعُ ٱللَّهِ ٱلنَّاسَ بَعْضَهُم بِبَعْضٍ لَّفَسَدَتِ ٱلْأَرْضُ وَلَٰكِنَّ ٱللَّهَ ذُو فَضْلٍ عَلَى ٱلْعَٰلَمِينَ ﴿251﴾
التفسير الميسر
فهزموهم بإذن الله، وقتل داود -عليه السلام- جالوتَ قائدَ الجبابرة، وأعطى الله عز وجل داود بعد ذلك الملك والنبوة في بني إسرائيل، وعَلَّمه مما يشاء من العلوم. ولولا أن يدفع الله ببعض الناس -وهم أهل الطاعة له والإيمان به- بعضًا، وهم أهل المعصية لله والشرك به، لفسدت الأرض بغلبة الكفر، وتمكُّن الطغيان، وأهل المعاصي، ولكن الله ذو فضل على المخلوقين جميعًا
Sahih International
So they defeated them by permission of Allah, and David killed Goliath, and Allah gave him the kingship and prophethood and taught him from that which He willed. And if it were not for Allah checking [some] people by means of others, the earth would have been corrupted, but Allah is full of bounty to the worlds
Marmaduke Pickthall
So they routed them by Allah's leave and David slew Goliath; and Allah gave him the kingdom and wisdom, and taught him of that which He willeth. And if Allah had not repelled some men by others the earth would have been corrupted. But Allah is a Lord of Kindness to (His) creatures
Abdullah Yusuf Ali
By Allah's will they routed them; and David slew Goliath; and Allah gave him power and wisdom and taught him whatever (else) He willed. And did not Allah Check one set of people by means of another, the earth would indeed be full of mischief: But Allah is full of bounty to all the worlds