Interesting question. For me, it was something I had to willfully bring about and practice to achieve. Even now I wouldn't say I'm 100% perfect at not caring when I shouldn't, but I think I'm better at caring for a second, then letting it go. If you see the difference there.
My thing is, I'm kind of reserved, and I've had to work at expressing the emotions I want people to know about--like excitement at a gift, for example. I've found that if I speak and act on the outside like I feel something, I often eventually truly feel that way on the inside as well. So if the issue is, say, a friend keeps winding you up about the drama in her life but refuses to actually take healthy steps to end it--next time she talks to you about it, practice acting like you aren't that interested, and eventually you may find that you really aren't that interested, and can think about other strategies like changing the subject.
Also, I like to "take a step back" and think about how and why the person is telling me something. Like, are they just trying to get a reaction out of me? Are they trying to get attention or blow off steam? What do they want me to say/do in response? (And do I want to say/do that?) Once I had a co-worker who always told me about all this drama in her life, these bad boyfriends she kept having, and she relayed it so quietly that it took me a long time to realize she was a drama queen who wanted attention for these stories and bad choices--then one day I overheard her telling the same story to three different people, and feeding off each one's shocked reaction. Then I realized why she was really doing this, and I stopped showing or, eventually, feeling much interest in the troubles she brought on herself.