Think of how others feel about your actions and words before you do and say them. Make a rule for yourself that you will think about something for a certain amount of time before you do or say it. If you think it'll hurt someone, don't say it unless it absolutely needs to be said. It might slow you down, but it'll stop you from hurting others.
Sometimes people put you off as rude or a jerk if you use to much sarcasm. They might not know you are just messing around. If you are going to joke around, maybe try to tell them you are joking so nothing gets taken the wrong way.