Or, foreshadowing. Of which there are two general kinds, which require — of course — different handling.
The first kind of foreshadowing is when you need something bad to happen to your characters unexpectedly — the equivalent of having your protagonist walking down the street without a care in the world, and then dropping a grand piano on his head. This needs to come as an unforeseen, and probably fatal, surprise to your protagonist; but not to your readers, who have little patience for plummeting pianos. Either you carefully plant, amid the usual distractions, the fact that the occupant of the fourth-floor-front apartment plays the piano, and hopes to trade in his or her current badly-tuned specimen for a better one someday; or you make it clear from the first pages of the book that your protagonist lives in the sort of film-noir universe where death by random piano is always a possibility.
The second kind of foreshadowing is when something bad is going to happen to one or more of your characters, and you want the reader to be aware that something bad is going to happen, and you want them to be waiting for it — the equivalent, in this case, of putting all your characters under a tornado watch and letting your readers sweat over the question of exactly which one of their fictional friends is going to see the funnel cloud snaking down out of the greenish-grey sky and hear the noise like an enormous freight train going over a bad grade. For that kind of foreshadowing, you need to start bringing the warning signs into the narrative early, a little bit at a time, and letting the frequency and the intensity build up slowly but steadily until the warning sirens begin to sound.
Because just as a stage whisper isn’t anything like a real whisper, fictional surprise isn’t anything like real surprise; it’s an artificial representation of the real thing. The real thing, if put unchanged into fiction, is liable to look fake.