Introduce a useful detail before it matters. Let the character notice or use it later. A payoff should connect to the earlier setup without solving the problem by an unrelated surprise.
Worked example
Early in a story, a character learns that a window latch sticks. Later, the same knowledge explains why the window will not open. The detail prepares the reader for the problem.
The Jammed Drawer
At the workshop, Ren notices a thin wooden strip beside the repair bench. The mentor explains that it can lift a loose catch without scratching the cabinet. Later, a drawer containing the parade map jams because its catch has slipped. Ren must get the map before the group leaves.