So I was telling some jokes to this terminally ill guy I don't remember the joke but it must have been funny, because he was dying.
I didn't understand the context. Maybe you could tell me what that was about?
Another funny joke I told this guy while he was dying, it's too bad he has a terminal illness.
That could be misunderstood as mocking people who are dying. Marginalizing dying people isn't cool.