Mindfulness meditation teaches you to recognize memories and damaging thoughts as they arise. It reminds you that they are memories. They are like propaganda, they are not real. They are not you. You can learn to observe negative thoughts as they arise, let them stay a while and then simply watch them evaporate before your eyes.