I have too often found myself sharing what I thought was wry humor, and yet the receiver found my comment offensive. Such is the challenge of ethical relativism, in particular when jokes contain body parts or religion, or worse, by the gods' gonads, both! As such, we should strive to be aware that everyone has a slightly different perspective.
Empathy, the ability to sense another's feelings in advance, is a hard won behavior. Sure, evolution has dealt us a starting hand of behaviors that reinforces positive social interaction, inclusive of a certain level of sensitivity to the various needs and wants of others. Nonetheless, our instinctive (and often unconscious) drive to survive and seek joy for ourselves can involuntarily trump the scene as we participate real time in our personal relationships and society.
Self-reflection as a mindful activity can assist as an ongoing journey of improving ourselves and positively influencing society and the world as a whole. By engaging an empathy feedback loop we can continually calibrate our behavior with a goal of improving our empathy factor. Which is to say judging ourselves with compassion and integrity is part and parcel to our human journey.
From a practical standpoint, engaging empathy in real time can be tricky. Like so much else, mindful practice can improve our abilities enormously. Listening with an open mind to friends thoughts, journaling without being too hard on ourselves, and simply reflecting on how others feel can empower our empathy implementation in the future. Having an earnest "I'm sorry" at the ready is also an imperfect solution. Indeed, the journey to wisdom and maturity comes with time and perseverance.
Does this mean we have to water down the spiciness of our satire, the acidity of mockery well deserved, or the outright sewage sourced material that provides counterpoint to a delusional apple pie Universe ? Of course not, esoteric topics can be brought to bare in moderation, but we certainly should be more attentive as to whether the people we're interacting with are actually laughing.