Along the same lines of discounting outs to your opponent (which you can really only do in an all-in situation when you can see his cards), you also discount outs that could make two different
hands for
yourself, i.e. you don't count the same outs again to make a different hand.
For example, if you had 4567 to the straight, you'd have 8 outs (four 3's and four 8's) to make the straight. If you held a 4 flush draw in hearts, you'd have 9 outs to make the flush. But if you held both, you'd deduct 3h and 8h from your flush outs (or alternatively, from your straight outs, doesn't matter as long as duplicate cards are excluded). So instead of 17 total outs you'd have 15.