Typically, I write by knowing what the character wants and continually asking myself what would stop them from getting it, what else can go wrong, and how they'd react.
But sometimes, I get stuck. I can't think of what else can go wrong. Or everything I can think of doesn't quite feel right.
So I use what I've already written. Often, there will be lines or details I throw in as I'm writing the first draft that I don't think twice about. But later, they can seem like seeds for foreshadowing.
For example, in my current work-in-progress, I have a character say "I'd kill anyone who laid a hand on my siblings." They're all much younger than her and it's totally within her character to say that. It doesn't have to foreshadow anything. But as I've gotten further in the draft, that line has become interesting. Perhaps someone will hurt one of her siblings. Perhaps she will try to kill that person. I wouldn't have guessed that for her, but you never know.
If that ends up happening, the line becomes foreshadowing and the best part was it was completely accidental.
Another example. Same novel, same character, says "desperate people are dangerous people." Nothing exciting there. The situation she said it in warrants the statement. But I've now realized she's going to become very desperate towards the climax. She's going to end up doing something dangerous and when she does, that line will be transformed from statement to foreshadowing.
So as you're writing, pay attention to lines like that. They don't have to mean anything, but it's also a great example for a plot idea if you need one with foreshadowing pre-built in!
They don't have to be bigger statements like that, either. Same novel, different character. After moving to a new school, she switches from Spanish to sign language. Fast forward a few weeks and her little brother hasn't said a word since they moved in. Honestly, sign language was the first thing I thought of. But will her taking it will prove to be useful with her brother? Only time will tell.
Maybe a character says they don't trust people who wear hats. Or they're afraid of dogs. Or they'd rather die than go to the ocean. Those can all be casual statements that do nothing more than characterize, or they can be prophetic. Things your character says they don't like make great obstacles later.
Or the opposite. Your character is really good at holding their breath. Or they never get lost. Or they're double-jointed in their shoulder. Is there an obstacle where those skills can prove useful?
If you need something to happen and don't know what, look at what your character has said. Use the things they said they dislike or are bad at to challenge them. Use the things they said they like or are good at to give them a leg up.
Foreshadowing can feel hard, but only if you add it in after the events. Don't force your foreshadowing. If something is mentioned earlier in the story, there's a reason you put it there whether you realized it or not. The less likely readers are to take the statement seriously the first time they read it, the better.
Details can be plot ideas and free foreshadowing. Take it and run and see where it leads you.
Have you ever used prior statements to form your plot? Where does accidental foreshadowing appear in your writing?
Accidental symbolism is also fantastic. Perhaps we'll talk about that in a few weeks.