Sarcasm is fun and it can be funny for everyone as long as it is not said in a hostile manner. You can sound mean when you say something sarcastic but the trick is to make it as jovial a possible or to crack a smile afterwards to show that you bear no ill will. Some people just have the gift of sarcasm.
Like Chandler Bing aka Matthew Perry’s role in Friends. He was the champion of sarcasm for most of the 10 seasons of that show but only some of it would seem mean and mostly it only sounded mean to Joey because he is, you know, Joey! Most of Chandler’s sarcasm is funny as hell and adds to the humour of the situation.
So keep Chandler as your inspiration and think “what would Chandler say in a situation like this or as a reply to this” before you say something sarcastic.
For eg; when asked if he didn’t cry when Bambi’s mother died in the cartoon movie, Chandler replies “Yes it was quite touching when the man stopped drawing the deer!”