لَّا يُؤَاخِذُكُمُ اللَّهُ بِاللَّغْوِ فِي أَيْمَانِكُمْ وَلَٰكِن يُؤَاخِذُكُم بِمَا كَسَبَتْ قُلُوبُكُمْ ۗ وَاللَّهُ غَفُورٌ حَلِيمٌ
Allah will not call you to account for that which is unintentional in your oaths, but He will call you to account for that which your hearts have earned. And Allah is Oft-Forgiving, Most-Forbearing.
It is in Surat Al-Baqarah,verse 225:
"Allah does not impose blame upon you for what is unintentional in your oaths, but He imposes blame upon you for what your hearts have earned. And Allah is Forgiving and Forbearing."
The first part (what is unintentional in your oaths) mentions to oaths which are vain, means some which people say them in this conditions:
1.Say it as habit; like vallah(والله)
2.Say it when he/she was sure about his/her speech, and after some realized he/she was wrong.
3.Say it when they are really Upset and angry.
4.And Oaths which adherence to them isn't Obligatory (vajib).
And Allah will not punish you for this kinds of oaths.
But the second part (what your hearts have earned) mentions to oaths which you say them upon your will and It is Informed. And for this kind of oaths if you be wrong,you will be punished. But remember Allah is Oft-forgiving, Most Forbearing.