When telling a story, you have to prepare the audience for certain events. If your hero is an expert swordsman, then you must show him demonstrating his skills or learning them before he actually needs to use them in a fight. Essentially what you need to do is setup a situation ahead of time and then pay it off later in your story.
Think of a good movie where the hero suddenly discovers some skill or information that he uses to overcome the villain. In “Star Wars,” Luke suddenly uses the Force, but if we never knew anything about the Force, this would seem to come out of nowhere and feel unrealistic as if the writer suddenly cheated us.
The reason we don’t feel cheated when Luke uses the Force to fire his photon torpedoes is because earlier we learned how Obiwan used the Force to get past the stormtroopers and teach Luke how to use his light saber without seeing his target.
So the setup was: Obiwan using the Force to control the stormtroopers and Obiwan teaching Luke to defend himself with a light saber using the Force and not his eyes.
The payoff is that Luke uses the Force to destroy the Death Star. By combining both a believable setup and a payoff, “Star Wars” feels realistic despite being science fiction.
In every good movie, something useful is first setup and then delivered as the payoff later on.
In “Rocky,” Rocky practices punching meat carcasses. When he’s in the fight with Apollo Creed, he uses this skill to hurt Apollo in the body by punching the ribs. That’s setup and payoff.
What happens if you omit the setup? Then you get something stupid like “The Phantom Menace” where the two Jedi knights are in a room and suddenly the villain seals the room and pumps in poisonous gas. By using the Force, the two Jedi knights survive.
There was no setup prior to this about the Force (unless you count knowledge of the three better “Star Wars” movies, which is lazy screenwriting). Before the Jedi knights could use the Force to escape poisonous gas, we should have seen a setup that would allow the Force to let Jedi knights survive without breathing for a lengthy period of time. Then the use of the Force with the poisonous gas would feel satisfying.
As it turns out, all those “Star Wars” prequels are horrible because they lack the necessary setup. All we get are payoffs that seem to come out of nowhere and save the hero at the last second. By using the Force to do everything, the hero becomes invincible and boring as a character as a result.
What happens if you neglect the payoff? Then you get a story where the hero packs a gun on a trip and we never see the gun ever used again. In that case, what’s the point of packing the gun in the first place if it has no relevance to the rest o the story?
In “Thelma and Louise,” we see Thelma packing the gun early in the film, then Louise uses that gun to shoot Thelma’s potential rapist. Once again, we get a setup and payoff.
If Louise had suddenly showed up with the gun and shot the rapist, it would have felt unrealistic because we’d wonder where the gun came from.
In “Die Hard,” we learn early on that Bruce Willis is a cop carrying a gun, so later when he uses the gun, that’s the payoff because we expect him to be good with a gun as a cop.
In your own story, go through and see what skills or tools your hero needs, then go back and set them up earlier in your story. Every time you introduce something new that helps the hero, you must set it up first. Your villain can get away with suddenly knowing marital arts and having a fully loaded Uzi conveniently nearby, but your hero cannot.
Your hero must struggle and fight for every advantage and that means setting up the hero’s skills and tools ahead of time, and then using them to pay off by saving the hero somehow as a result.