Let $f : \mathbb{R}^n \to \mathbb{R}$ be a smooth function. A point $p \in \mathbb{R}^n$ is called a critical point if $$\frac{\partial f}{\partial x_1}(p) = \dots = \frac{\partial f}{\partial x_n}(p) = 0.$$
A critical point $p$ is called non-degenerate if the Hessian matrix at $p$
$$\left[\frac{\partial^2 f}{\partial x_i\partial x_j}(p)\right]$$
is non-singular (i.e. invertible).
Morse Lemma: Let $p$ be a non-degenerate critical point of $f : \mathbb{R}^n \to \mathbb{R}$. Then there is an neighbourhood $U$ of $p$ and coordinates $(y_1, \dots, y_n)$ on $U$ such that $y_1(p) = \dots = y_n(p) = 0$ and for every $q \in U$, we have $$f(q) = f(p) - y_1(q)^2 - \dots - y_k(q)^2 + y_{k+1}(q)^2 + \dots + y_n(q)^2.$$
The number $k$ is called the index of $f$ at $p$. It is a well-defined quantity (i.e. you can't get a different value of the index by using a different coordinate system). In fact, $k$ is equal to the number of negative eigenvalues of the Hessian matrix at $p$. Note that $0 \leq k \leq n$.
Non-degenerate critical points in $\mathbb{R}^n$ are classified by their index. Indeed, if $n = 2$, there are three possibilities for the index: $0$, $1$, or $2$. These correspond to a local minimum, saddle point, and local maximum respectively.
Index $0$: For all $q \in U$, we have $$f(q) = f(p) + y_1(q)^2 + y_2(q)^2 \geq f(p),$$ so we see that $p$ is a local minimum.
Index $1$: For all $q \in U$, we have $f(q) = f(p) - y_1(q)^2 + y_2(q)^2$.
Along the curve $y_1 = 0$, $$f(q) = f(p) + y_2(q)^2 \geq f(p),$$ so $p$ is a local minimum along $y_1 = 0$.
Along the curve $y_2 = 0$, $$f(q) = f(p) - y_1(q)^2 \leq f(p),$$ so $p$ is a local maximum along $y_2 = 0$.
Therefore, $p$ is a saddle point.
Index $2$: For all $q \in U$, we have $$f(q) = f(p) - y_1(q)^2 - y_2(q)^2 \leq f(p),$$ so we see that $p$ is a local maximum.
It is also worth considering the case $n = 1$ from this point of view. All non-degenerate critical points are either local minima (index $0$) or local maxima (index $1$), and zeroes of the derivative which are neither, sometimes called stationary points of inflection, are degenerate critical points.
As in the specific cases $n = 1, 2$, a critical point with index $0$ is a local minimum and a critical point with index $n$ is a local maximum. For $0 < k < n$, you can intuitively think of the critical point as having $k$ independent directions along which $p$ is a local maximum, and $n - k$ independent directions along which $p$ is a local minimum.
The study of non-degenerate critical points can also take place on a smooth manifold. The relation between such points and the topology of the manifold is known as Morse Theory.