Let $M,N$ be nonempty, smooth manifold of the same dimension. Let $N$ be compact and $M$ be connected. Suppose that $f:N\rightarrow M$ is an embedding. We want to show that $f$ is a diffeomorphism.
Since $f$ is an embedding, then we know that
$f(N)\subset M$ is a smooth submanifold, and
$f:N\rightarrow f(N)$ is a diffeomorphism. That is we identify the domain $N$ with its image $f(N)\subset M$ such that $N\subset M$.
We would like to show that $f$ is a diffeomorphism. So, we need to show $f$ is an invertible smooth map.
I found the answer here: Smooth embeddings that are homeomorphisms but not diffeomorphisms
Since we have an embedding, then $f$ is an immersion.
Since $f$ is an immersion and the dimension of $M$ and $N$ are the same, then we have a local diffeomorphism.
Therefore, $f^{-1}:M\rightarrow N$ is also smooth. We have shown $f$ is an invertible smooth map. Hence, $f$ is a diffeomorphism.