Put it near the end of a scene, just after the threat is made, so it acts as the payoff before the action cuts away. Follow it with a reload gun sound to sell the next move, or use a fail sound meme straight after if the threat falls flat and the joke needs a reset.