This is a really good blog I found on why Jesus said not to swear. It explains his words in the context of Jewish customs. It's a really enlightening article.
https://www.crossway.org/articles/did-jesus-forbid-us-from-taking-oaths-matthew-5/?utm_source=Crossway+Marketing&utm_campaign=e16010d644-20220115+-+General+-+Oaths+Matthew+5&utm_medium=email&utm_term=0_0275bcaa4b-e16010d644-296999681