Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:23:28

And when you have boarded the ship, you and those with you, then say, 'Praise to Allah who has saved us from the wrongdoing people.'  

And when you have settled, ˹when˺ you are balanced, in the Ark together with those with you, say, “Praise be to God Who has delivered us from the wrongdoing folk”, ˹from˺ the disbelievers and the destruction that came upon them.
القرآن:٢٣:٢٨

فَإِذَا اسْتَوَيْتَ أَنْتَ وَمَنْ مَعَكَ عَلَى الْفُلْكِ فَقُلِ الْحَمْدُ لِلَّهِ الَّذِي نَجَّانَا مِنَ الْقَوْمِ الظَّالِمِينَ  

{فإذا استويت} اعتدلت {أنت ومن معك على الفلك فقل الحمد لله الذي نجانا من القوم الظالمين} الكافرين وإهلاكهم.