I've seen flashbacks a lot in media. Movies, TV shows, games, books, and just about anything else which has a story component.
But imo, it's rare for a flashback to be done well. So often I see flashbacks and similar used as a sort of easy way out of actually writing a scene where the character portrays their emotional state as a result of that moment in the past, and this usually comes pair with relatively shallow characters in general. An example of these "lazy" flashbacks to me is the Disney star wars trilogy; I felt the flashbacks skipped the opportunity to spend time with characters and give them depth.
What makes a flashback work for you?