Take away their power
The offensive person chooses to behave or speak indecently; choose not to be offended. Start by realizing how lucky you are not to be them – after all, would you rather be the offender or the offended? Next, remember their behavior is their problem; don’t make it yours.
Call them out on their behavior
Offensive people get to us because they splat on our day like pigeons. You can call them out in public or in private with a comment such as, “Hope you didn’t mean to say that but if you did, I hope you realize later that it wasn’t OK.” This works best if you critique their remark or action and not them directly. For example, you can say, “Please don’t say that in front of me,” or any other honest statement that says stop it.