I asked a similar question earlier about how I unintentionally say “Jesus christ” at times when I’m annoyed or frustrated. I didn’t realize this was a major sin. How can I repent from this
"There is no blame on you for what you do by mistake, but ˹only˺ for what you do intentionally. And Allah is All-Forgiving, Most Merciful." (Translation by Dr Mustafa Khattab)
Al Ahzab verse 5
"Allah does not require of any soul more than what it can afford. All good will be for its own benefit, and all evil will be to its own loss. ˹The believers pray,˺ “Our Lord! Do not punish us if we forget or make a mistake. " (Translation by Dr Mustafa Khattab)
Al Baqarah verse 286
Try to stop what you're doing, and try to avoid it. Replace the word you're using with Istighfar. and Maybe this hadith is related to your problems
The Prophet (ﷺ) said, "He who takes an oath and involuntarily says: 'By Al-Lat and Al-'Uzza' should at once affirm: 'La ilaha illallah (there is no true god except Allah)', and he who says to his companion: 'Come let's gamble' should make expiation by giving something in charity."
(For context, Lat and 'Uzza is a fake idol)
and Ask Allah سُبْحَانَهُ وَ تَعَالَى for forgiveness.
If you do not know that a certain act is prohibited in Islam then there is no sin upon you. In Islam, sin is based on the acts that we do willingly with knowledge of what religion says about it.
In Surah Al-An'am Ayat 54 Allah (subhanahu wa ta'ala) clears states:
When those come to thee who believe in Our signs, Say: "Peace be on you: Your Lord hath inscribed for Himself (the rule of) mercy: verily, if any of you did evil in ignorance, and thereafter repented, and amend (his conduct), lo! He is Oft-forgiving, Most Merciful.
Also, try your best not to say it again. Instead, when you are angry or frustrated, try saying: “ A'oodhu billahi minash shaytaannir rajeem" (I seek shelter in Allah from satan, the rejected). This is a cure, which was practiced by the Holy Prophet (PBUH) himself.