The Theorem 29.2 in Munkres' Topology textbook states as follows:
Theorem 29.2. Let $X$ be a Hausdorff space. Then $X$ is locally compact if and only if given $x \in X$, and given a neighborhood $U$ of $x$,there is a neighborhood $V$ of $x$ such that $\overline{V}$ is compact and $\overline{V} \subseteq U$.
Proof: Clearly this new formulation implies local compactness; the set $C = \overline{V}$ is the desired compact set containing a neighborhood of $x$. To prove the converse, suppose $X$ is locally compact, let $x$ be a point of $X$ and let $U$ be a neighborhood of $x$. Take the one-point compactification $Y$ of $X$, and let $C$ be the set $Y - U$. Then $C$ is closed in $Y$, so that $C$ is a compact subspace of $Y$. Apply Lemma 26.4 to choose disjoint open sets $V$ and $W$ containing $x$ and $C$, respectively. Then the closure $\overline{V}$ of $V$ in $Y$ is compact, furthermore, $\overline{V}$ is disjoint from $C$, so that $\overline{V} \subset U$, as desired.
I am curious about the sentence "Take the one-point compactification Y of X," since the one-point compactification of X exists if and only if X is locally compact and not itself compact.
Should it not be replaced by "Let $Y = X\cup \{ \infty \}$" where $\{ \infty \}$ is the point which makes Y compact Hausdorff with the topology inherited by the union of the topology of X and the co-set of the collection of the closed set of X or is there something I am missing?
Thank you very much in advance.
You are right, Munkres himself states
Therefore Munkres' proof of the converse only works if $X$ is not compact.
What can be done to repair the proof? There are various approaches.
Avoid the use of the one-point compactification and proceed as in Oliver Díaz' answer.
First treat the case that $X$ is compact; then Munkres' proof works if we take $Y = X$. Next treat the case that $X$ is not compact.
Proceed as you suggested by always taking $Y \supset X$ to be the essentially unique compact Hausdorff space such that $Y \setminus X$ consists of a single point (see Theorem 29.1). Note that if $X$ is not compact, then $Y$ is one-point compactification of $X$; if $X$ is compact, then $Y$ is the disjoint union of $X$ and a one-point space.
As Anne Bauval writes, this space $Y$ is known as the Alexandroff extension (or Alexandroff compactification) of $X$. This is defined for all topological spaces $X$ and is always compact though in general not Hausdorff (it is Hausdorff if and only of $X$ is locally compact Hausdorff). See Confusion about Alexandroff Extension.