All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
It seems that you meant that if you do that thing you will become a Kaafir; which means if you do what necessitates Kufr or shirk. This is something that you are not permitted to fulfill.
If we presume that you conditioned Kufr upon doing such a thing, then you do not become a Kaafir by doing it, but you are obliged to expiate for breaking an oath.
Shaykh Ibn Taymiyyah quoted in his Fataawa the agreement of the scholars that the person in this case is not ruled to be a Kaafir. He said in his book Mujmoo’ Al-Fataawa:
“If one says: he becomes a Jew or a Christian if he does such and such a thing, or that if he does such and such he becomes a Kaafir, and so on, then the scholars agreed that if he fulfills the condition, then he does not become a Kaafir. However, he must expiate for breaking an oath, according to Abu Haneefah and according to the famous view of Ahmad.” [End of quote]
Therefore, if the oath that you broke was about doing a sin, then you must repent to Allah, and you must expiate for breaking an oath.
Allah knows best.