This is not a complete answer to the question "where is completion used?": I just want to give an example of its usefulness. In the following, we work over $\mathbb{C}$.
Let us say that we want to classify singularities of curves: our first task would be to understand when two singularities are the same and when they are not. How to do that? Clearly, we should use a tool that permits us to look at the behavior of the singularity, i.e. how the curve look like near the singular point. So, a first attempt might be to define two singularities on two curves to be the same when the coordinate rings of the curves, localized at the singular points, are isomorphic. Actually, this is not a good definition.
Indeed, take the two curves $C_1$ and $C_2$ in $\mathbb{C}^2$ respectively defined by the ideals $(y^3+y^2-x^2)$ and $(xy)$. Let me remark that these two curves are not isomorphic, as $C_1$ is irreducible whilst $C_2$ is not. Now, both of them have a singularity in the origin, and by drawing a picture we immediately see that the two singularities must be the same in our classification, as near the origin the two curves look pretty similar. But if we take the localization of the coordinate ring of $C_1$ and $C_2$ near the origin we obtain two non-isomorphic local rings (one of them is a domain, the other is not).
Another obvious example is given by regular points: clearly, in our classifications of singularities we would like to consider all the regular points in the same class of singularity, namely "non-singular". But again, if we take localization of coordinate ring at regular points, in general we will obtain non-isomorphic local rings.
The point is that the localized rings give us information about the local behavior of the curve near the singular point in the Zariski topology, and the open sets of the Zariski topology are too big to tell you what is happening really close to the singular point. If we take instead $\mathbb{C}^2$ with the euclidean topology in the example above, we can find an open neighborhood of the origin such that, inside it, the two curves $C_1$ and $C_2$ are topologically (and analytically) isomorphic.
Completion is the algebraic tool that permits us to analyze the behavior of the curve around the point "more locally" than we would be able to do with localization, that only tells us about what is happening around the point by approaching it via smaller and smaller Zariski open neighborhoods. And it works! Indeed, the completion of the local rings of $C_1$ and $C_2$ around the origin are both isomorphic to $\mathbb{C}[[x,y]]/(xy)$, as we were expecting. Also, the Cohen structure theorem tells us that the completion of the local ring of a curve at a regular point is always isomorphic to the ring of formal power series in one variable $\mathbb{C}[[x]]$. Thus, we can now define two singularities of two curves to be the same (more formally, analytically isomorphic) iff the completion of the localization of the coordinate rings of the curves at the singular points are isomorphic. In this way, by what we have observed before, the two singularities of $C_1$ and $C_2$ are the same, namely they are both a node, and regular points are all of the same kind, namely non-singular.
Now you may wonder why we have introduced completion when we could just use the euclidean topology to define classes of singularities. The point here is that we can extend this definition to curves defined over an algebraically closed field $k$. In this context we do not have anymore a euclidean topology and we can only use "algebraically defined" notions, as completions.
A final remark: as stated before, the key observation is that Zariski topology is too coarse for certain scopes. A beautiful idea of the second half of the last century was to consider, instead of the Zariski topology, the so called Grothendieck topologies. These are not topologies in the usual sense (but usual topologies are particular cases of Grothendieck topologies) and they are the right tools to study algebraic varieties in a refined way. In particular, by taking a particular Grothendieck topology called étale topology, which captures a lot more topological information of the algebraic varieties than the Zariski topology, we can talk of the étale neighborhood of a point. Algebraically, this corresponds to taking a refined version of the completion of a local ring, i.e. its strict henselization.