When you have flashbacks it is worth trying various grounding skills you can look up this online. You may also be able to get medication to reduce the frequency of flashbacks and it is worth speaking to a therapist who might be able to give you some tips.
Flashbacks occur usually from a traumatic experience that has imprinted on your mind. When you get yourself in a similar situation you can flashback to this traumatic experience. Going to a psychologist and discussing your flashbacks and the traumatic experience can help. They can give you strategies to learn to manage situations that have triggered a flashback.
Talk to someone, a lot of times talking about traumatic memories helps. If you can't talk about them, channel your flashbacks into creativity. Paint, make music, dance, and who knows, maybe one day you will forget all about them.
Remind yourself that the worst is over, and you survived it. These are just feelings, and memories of an event that occurred in the past. You were strong, and overcame this moment. You can overcome these memories too. Take a deep breathe, notice your surroundings, and tell yourself that you are safe now.