It's nothing more than a misdirection of your emotions. It's the same reason some people say hurtful things they don't really mean when they're angry, or some people will hurl objects across the room.
It is common, but not healthy. You can cope, however, and learn better thoughts and behaviors.
Meditation can be a great help. Mindfulness techniques, learning to acknowledge thoughts but let them go (not to dwell on them), and more, can do wonders.
But it is not an instant change. It is a process.