For example, my child spends all his/her pocket money for snacks in one day. Then, I swear that I won't give any money to him/her forever.
What should I do after a situation like this?
لاَ يُؤَاخِذُكُمُ اللّهُ بِاللَّغْوِ فِي أَيْمَانِكُمْ وَلَكِن يُؤَاخِذُكُم بِمَا عَقَّدتُّمُ الأَيْمَانَ فَكَفَّارَتُهُ إِطْعَامُ عَشَرَةِ مَسَاكِينَ مِنْ أَوْسَطِ مَا تُطْعِمُونَ أَهْلِيكُمْ أَوْ كِسْوَتُهُمْ أَوْ تَحْرِيرُ رَقَبَةٍ فَمَن لَّمْ يَجِدْ فَصِيَامُ ثَلاَثَةِ أَيَّامٍ ذَلِكَ كَفَّارَةُ أَيْمَانِكُمْ إِذَا حَلَفْتُمْ وَاحْفَظُواْ أَيْمَانَكُمْ كَذَلِكَ يُبَيِّنُ اللّهُ لَكُمْ آيَاتِهِ لَعَلَّكُمْ تَشْكُرُونَ
Allah will not impose blame upon you for what is meaningless in your oaths, but He will impose blame upon you for [breaking] what you intended of oaths. So its expiation is the feeding of ten needy people from the average of that which you feed your [own] families or clothing them or the freeing of a slave. But whoever cannot find [or afford it] - then a fast of three days [is required]. That is the expiation for oaths when you have sworn. But guard your oaths. Thus does Allah make clear to you His verses that you may be grateful.
Maide 89 (5/89)
If someone oaths for a bad thing (with actually putting meaning to it - not with the way of speaking without caring), he/she has to feed ten families as the way he/she feeds his/her own family. Or, he/she must must cloth them. Or, he/she must find and free a slave. If he/she is not able to do any of these, then he/she must have fast for three days.
وَلاَ تَجْعَلُواْ اللّهَ عُرْضَةً لِّأَيْمَانِكُمْ أَن تَبَرُّواْ وَتَتَّقُواْ وَتُصْلِحُواْ بَيْنَ النَّاسِ وَاللّهُ سَمِيعٌ عَلِيمٌ
And do not make [your oath by] Allah an excuse against being righteous and fearing Allah and making peace among people. And Allah is Hearing and Knowing.
Bakara 224 (2/224)
لاَّ يُؤَاخِذُكُمُ اللّهُ بِاللَّغْوِ فِيَ أَيْمَانِكُمْ وَلَكِن يُؤَاخِذُكُم بِمَا كَسَبَتْ قُلُوبُكُمْ وَاللّهُ غَفُورٌ حَلِيمٌ
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.
Bakara 225 (2/225)
Allah does not want us to do bad things because of our oaths. On the other hand, we should be careful about oaths and not oath for every single matter.
According to Jafari Fiqh oath out of anger without intent is not valid and is canceled and so will have no obligation.