This is not a detailed description, because it gets confusing really fast. There can be some factors where you have to reduce the significance of some outs because of the specific situation. It sounds like you want a formula, so here is an easy one that approximates the chance you will hit:
1. Determine how many cards might be left in the deck that will give you the desired hand.
Here are some general ones encountered:
4 outs= 2 pair needing a full house or an inside straight draw
6 outs= 2 over cards needing to make a pair
8 outs= open ended straight draw
9 outs= flush draw
11 outs= flush draw w/pair that could make trips
12 outs= flush draw w/inside straight draw
14 outs= flush draw w/pair that could make trips (one of the pair is on the board) or to hit kicker to make 2 pair
2. After the flop, multiply by 4 and you have the rough percentage to make your hand. After the turn multiply by 2 and you will have the rough percentage to make your hand.
3 Calculate the pot
odds to determine if you should stay in the hand.