Sure Al-Baqara

2:225

لَّا يُؤَاخِذُكُمُ ٱللَّهُ بِٱللَّغْوِ فِىٓ أَيْمَٰنِكُمْ وَلَٰكِن يُؤَاخِذُكُم بِمَا كَسَبَتْ قُلُوبُكُمْ ۗ وَٱللَّهُ غَفُورٌ حَلِيمٌۭ

Allah wird euch nicht für etwas Unbedachtes in euren Eiden belangen. Jedoch wird Er euch für das belangen, was eure Herzen erworben haben. Allah ist Allvergebend und Nachsichtig.

Tafsir 2:225

Allah will not take you to account for those oaths that you swear unintentionally, such as if someone carelessly says, ‘No, by Allah!’ or ‘Yes, by Allah!’ For such oaths there is no need to make any compensation, nor any further consequences. However, He will take you to account for intentional oaths. Allah forgives and tolerates the sins of His servants and is not hasty in sending punishment.