Let the student know everyone gets frustrated or stuck on something and they do not have to stop being frustrated but maybe try using another statement
Examples of replacement statements:
I can’t do it -> I can try again
I’m not smart -> I am learning
I don’t get it -> I can ask for help
Together with the student, brainstorm some words they can use in place of profanity or inappropriate language, like “dar” instead of damn, “bummer” in place of shit, etc.
The student will need frequent reminders and practice until they develop a new habit of using the replacement words, so be patient and supportive, giving reminders and cues when needed