I have a hard time myself with this because just for some random reason if things are not going the direction I would like it to and I'm just by myself, I want to let out a swear word. It's really common for people to do this anywhere, including old men nearing their 70s like my dad. I'm not really satisfied by how I just give into it and makes me feel rotten in some sense. I believe this is the area of self-control and self-awareness with a lot of it centered around it.
It's funny because when we are around some people like adorable kids or maybe someone very important, we usually won't just start blabbering out bad words from not wanting to leave that type of impression, so it will probably hard press us to stay outwardly nice while the thinking can be so whack momentarily if we're upset underneath. I guess it's a matter of just regaining composure if anyone goes through it and going back into the grinder for whatever purpose the person has found.
Overall, I think it's about just remaining calm as possible while making yourself relaxed and sticking with it while putting a lot of effort to come up with a resolution that will make you happy and this involves considering everything. It can be even more stressful to think even more about something unpleasant, but this is what people who desire to be problem solvers do. Seriously, most of the things I go through isn't even something to take that seriously now and it just makes me feel a whole lot better and smarter to open up with someone or possibly a group of people who are trying to bother me about it. You know, there's also nothing wrong with leaving them behind and moving on to work on something desirable.