Bounded and Closed but not Compact

I had been proposed to construct not compact set that is however bounded and closed.

I could easily imagine from the different metric - such as discrete metric where

$d(x,y) =0$ if $x=y$ and $d(x,y) =1$ if $x \neq y$ then M itself is closed since it is metric itself and bounded by $D(x,2)$, but is not compact since there's $D(x,1/2)$ which is open cover of $M$ with no finite sub-cover

any how to construct bounded and closed but not compact set in complete metric?

Let $X=L^1(\Bbb R)$ be the space of Lebesgue integrable functions on $\Bbb R$ (strictly speaking we need to factor out by null functions). This is a complete metric space with $$d(f,g)=\|f-g\|=\int_{\Bbb R} |f-g|.$$ Then $\{f\in X:\|f\|_1\le 1\}$ is closed, bounded but not compact.
A subset of a banach space is compact if and only if it is closed and totally bounded. The closed unit ball in $l^1(\mathbb R)$ centered around $0$ is not totally bounded. For example because it is not a finite union of open balls of radius $\frac{1}{2}$, simply because each such ball can contain at most one of the sequences of the form $0,0,\dots, 0, 1,\dots$ (this is clear by the triangle inequality).
If $(X,||*||)$ is a normed space and if $B=\{x \in X: ||x|| \le 1\}$, then $B$ is closed and bounded. The following assertions are equivalent:
$(1)$: $B$ is compact;
$(2)$: $\dim X < \infty$.