Many people swear for any trivial reason, even though Allah says, {But guard your oaths} [Al-Ma-idah: 89] i.e., protect it by not swearing a lot. As when you do this (take oaths) it is a way of glorying Allah. Actually Allah prohibited his slaves from making oaths that stop them from doing good deeds, avoiding bad deeds or making peace between people, as Allah says, {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}[Al Baqarah: 224].
https://www.islamkingdom.com//en/rul...oaths-in-islam