Swearing is a way of speaking that some people use to express. Mostly their feelings of anger, annoyance, and frustration or when they want to hurt someone else's feelings. People even swear because they think it is funny or smart.
If you are frustrated or angry there are lots of other words to use to make you feel better. Try and make up your own words. Make up a work like "Angry Tomato" or "Joe Smoe" to express your anger. This way, it can be funny when said and it won't be offensive.