There are some "secret" assumptions involved in these kinds of problems, e.g. peoples' names have finite length, say at most $K$ characters, and do not grow with your $n$. Then, I guess you know the drill. You list the names of people (with their associated phone numbers) alphabetically, say as,
Aaron, (314) 159 2654
Anderson, (217) 828 1828
Artichoke, (999) 999 1999
Artin, (123) 456 7890
...
Now, if you want to look for the phone number for Jack, you start from the middle of the list and compare your Jack with the name you see over there (which requires roughly $K$ comparisons by our assumption above). There are three possibilities: If that name matches "Jack," then you are done. If that name comes after Jack alphabetically (such as in the case of "Joe"), then you throw all the names after (and including) that name. Otherwise, you throw all the names before (and including) that name. Now, you have a smaller list (of size $\frac{n}{2}$ or $\frac{n+1}{2}$) and you continue in the same manner with this smaller list you have. Eventually, you will have done (roughly) $K\log_2 n$ comparisons. Since $K$ is independent of $n$, this is $O(\log n)$.