وَكُلًّا نَّقُصُّ عَلَيْكَ مِنْ أَنۢبَآءِ ٱلرُّسُلِ مَا نُثَبِّتُ بِهِۦ فُؤَادَكَ ۚ وَجَآءَكَ فِى هَـٰذِهِ ٱلْحَقُّ وَمَوْعِظَةٌ وَذِكْرَىٰ لِلْمُؤْمِنِينَ
Asad Quran Translation
AND [remember:] out of all the accounts relating to the [earlier] apostles We convey unto thee [only] that wherewith We [aim to] make firm thy heart:154
for through these [accounts] comes the truth unto thee, as well as an admonition and a reminder unto all believers.
I.e., the Qur'an does not intend to present those stories as such, but uses them (or, rather, relevant parts of them) as illustrations of moral truths and as a means to strengthen the faith of the believer (see the second part of note  as well as note  above).
Malik Quran Translation
All these stories of the prior Rasools that We relate to you (O Muhammad) are to strengthen your heart therewith; through these you have received the knowledge of reality and the believers have gotten admonition and a reminder.
Yusuf Ali Quran Translation
All that We relate to thee of the stories of the apostles with it We make firm thy heart: in them there cometh to thee the Truth as well as an exhortation and a message of remembrance to those who believe. 1624
The stories of the Prophets in the Qur-an are not mere narratives or histories: they involve three things: (1) they teach the highest spiritual Truth; (2) they give advice, direction, and warning, as to how we should govern our lives, and (3) they awaken our conscience and recall to us the working of Allah's Law in human affairs. The story of Joseph in the next Sura is an illustration in point. A) Cf. xi. 93 and vi. 135, n. 957. The worst that ye can will not defeat Allah's Plan; and as for us who believe, our obvious duty is to do our part as taught to us by Allah's revelation.
Mustafa Khattab Quran Translation
And We relate to you ˹O Prophet˺ the stories of the messengers to reassure your heart. And there has come to you in this ˹sûrah˺ the truth, a warning ˹to the disbelievers˺, and a reminder to the believers.
Piktal Quran Translation
And all that We relate unto thee of the story of the messengers is in order that thereby We may make firm thy heart. And herein hath come unto thee the Truth and an exhortation and a reminder for believers.
Wakullan naqussu AAalayka min anbai alrrusuli ma nuthabbitu bihi fuadaka wajaaka fee hathihi alhaqqu wamawAAithatun wathikra lilmumineena