If you have QJ and the flop comes QJ2 (let's say all hearts). You think the other guy has a flush, and you want to know whether to call his bet.

You have four outs to make your full house. (two more jacks and two more queens.)

Your odds of getting on the turn OR the river= odds of getting on turn + odds of NOT getting on turn AND getting on river

Odds of getting on turn= 4 cards that help/47 unseen= 4/47= 0.08511
Odds of NOT getting on turn= 1 - 0.08511= .91489
Odds of getting on river= 4 cards that help/46 unseen= 4/46= 0.08696

0.08511 + (.91489)*(0.08696) =0.16467= 16.47%

Pot should be greater than 5x the bet for you to call.