Some stories take place in consecutive scenes not far apart in time. In such stories, everything that readers need to know is available in those scenes. Then there are other stories that occur all over the temporal map: present scenes and scenes from the childhood of the protagonist that are required to understand the current story. To create coherent stories of such story, flashbacks are needed. To write flashback effectively, you need to:
Have a trigger that ignites flashbacks
Memories rarely arise out of nowhere; something in the present must trigger them. For instance, the smell of flowers could remind a character the gift he presented to his girlfriend. Therefore, when writing flashback, ensure that there is an external stimulus that pushes the consciousness of your character into the past.
Have a trigger that brings back your character to the present
Just like there is a trigger that ignites flashback, there should be a trigger to bring back your character to the present. For example, say your character is remembering how his friend died. You can have the sound of rain outside in the present at the end of the flashback scene.
Keep the flashback brief
Chances are you are using flashback to get across one important point. Therefore, cut it down to its important moments. If readers have to read many pages of backstory, they will not understand why you didn’t just include the flashback into the longer time frame of the novel.