Take $X = \mathbb{A}^1$ and $Y = \{0\}$. I want to take the formal group scheme at $Y \subset X$. This is a locally ringed space, $(Y, \mathcal{O}_{ \hat{X}})$ where $\mathcal{O}_{\hat{X}}$ is the $(x)$-adic completion of $k[x]$, i.e. $k[[x]]$.
This might be vague, but why formal schemes, i.e. what is the difference between this formal scheme and $Spec (k[[x]])$? For example, is the category of coherent sheaves (defined on any ringed space) equivalent for the two? I suppose the underlying topological space is different, but why would you prefer one over the other?