Place it at the start of a rising gag, before the payoff, then follow a failed climb with the fail sound and a successful one with clapping to close the joke.