“Be careful with your words. Once they are said, they can be only forgiven, not forgotten.”
If you find yourself regretting your words from time to time, it is worthwhile to work on thinking before you speak. Actually, just acknowledging to yourself that you have a tendency to speak without thinking is a crucial first step.
Not every thought that comes through your mind needs to be said. Take time to filter your thoughts before you speak them. Eliminate the thoughts that will bring you temporary relief of stress but really are trouble.
Your initial perception of the situation may actually be wrong. Look at it from several angles. You might be overreacting. You might be looking at it only from your angle. You might be assuming their intention incorrectly.
Once you have widened your perspective and you decide it is still important to say something, choose your words (and the setting) so that the other person can accept your words.