If B1, B2, ... partition the sample space, P(A) = sum of P(A | Bi) P(Bi).
The expectation version is more useful in interviews: E[X] = sum of E[X | Bi] P(Bi).
The technique is to condition on the first step of a process. When the remaining problem is identical to the original, you get an equation in the answer itself: E = 1/2(1) + 1/2(1 + E) gives E = 2 for the expected flips to the first head.
Choosing well matters. A good partition makes each branch either trivial or self-similar. If your split produces three cases as hard as the original, split on something else.