There's no magical handbook that tells you how to prove a given theorem. But here are some fairly common rules of thumb:
First, note that "proving the contrapositive" and "proof by contradiction" are identical. You use this method generally when you're trying to prove something of the form X -> Y where ~Y gives you some useful information to work with. For example, "if k is a prime number greater than 2, k is odd." Assume ~"k is odd" (ie, k is even), then k must be divisible by 2, and since k > 2, k is necessarily not prime.
Direct proof is commonly used when X gives you some useful information to work with. For example, "if f(x) is a differentiable even function, then f'(0) = 0." Using the fact that f is an even function, we can say lim h->0 (f(h) - f(-h))/h = lim h->0 (f(h) - f(h))/h = 0, so f'(0) = 0.
Proof by counterexample is useful when you're trying to prove something like ~X where X contains a "for all" quantifier. This is generally used in lower level university math classes when disproving something, for example "if k is prime, k is odd." Clearly k = 2 is a counterexample to that.
And, as
>>3 said, do lots of proofs and you'll get a feel for it.