Since all exact forms are closed (To see this, suppose $\omega$ is an exact $n-$form, then there exists some $(n-1)-$form $\eta$ such that $d\eta=\omega$ but then $d\omega=d(d\eta)=d^2\eta=0$ thus $\omega$ is closed), the de Rham cohomology measures to what degree closed forms fail To be exact (this is a quote from Terence Tao, not taking credit but this seems to be the best laymen's terms method of phrasing it). If the de Rham cohomology group is trivial all closed forms are exact. It’s a measure of when the fundamental theorem of calculus fails in higher dimensions. I.e., the $p-$th de Rham cohomology of some smooth manifold with or without boundary (oriented, for non-oriented one must add a twist but it still holds), say $M$ is
$$H_{\text{dR}}^p(M)=\{\text{closed $p-$forms on $M$ modulo exact $p-$forms on $M$}\}.$$
(To rigourously define this requires the heavy machinery of sequences which are certain "nice" maps between say $n$ forms and $n+1$ forms on a given smooth manifold with or without boundary, but in a nut shell its just closed forms modulo exact forms in the algebraic sense of modding out by a normal subgroup.)
So if this group is trivial all closed forms are exact. If it is non-trivial, then there exists closed $n-$forms on $M$ that are not exact. For instance a case where the de Rham cohomology is trivial is on a star shaped domain. This is known as the Poincaré Lemma .Recall, a space $S$ is said to be a star-shaped domain if there exists a point $s\in S$ such that the line between this point and any other points lies within $S$. The ideal picture of one in $\Bbb{R}^2$ is an actual star as the center can be connected to all other points in $S$ with a straight line such that the line still lies entirely within $S$.
Cool fact 1: for the $n-$sphere, all closed $p-$forms for $0<p<n$ are exact. And for $\Bbb{R}^n$ when $n>1$, we have that the only non trivial de Rham cohomology groups of this space minus a point are the $0$ and $n-1$ de Rham cohomology groups. I.e.,for $n>1$, if $\overline{x}\in\Bbb{R}^n$ is given by say $\overline{x}=(x^1,x^2,…,x^n)$ its coordinate representation in $n-$space, then
$$H_{\text{dR}}^p(\Bbb{R}^n\setminus \{\overline{x}\})=0$$
Except when $p=0, n-1$.
Cool fact 2: It can be used to show $\Bbb{R}^m\cong\Bbb{R}^n$ iff $m=n$. This is done so by considering the de Rham cohomology group when removing a point. That is, we suppose $\Bbb{R}^m\cong\Bbb{R}^n$, then let $U$ be an open neighborhood homeomorphic to both. Then while it is homeomorphic to $\Bbb{R}^n$,
$$H_{\text{dR}}^{n-1}(U\setminus \{\overline{x}\})\neq 0$$
but since it is also homeomorphic to $\Bbb{R}^m$,
$$H_{\text{dR}}^{n-1}(U\setminus\{\overline{x}\})=0$$
and the de Rham cohomology groups are topological invariants thus $m=n$. In other words for $U\subset\Bbb{R}^n$,
$$H_{\text{dR}}^p(U\setminus\{\overline{x}\})=0$$
when $p\neq 0,n-1$.
For an example of closed not being exact, @anomaly gave the classical example as seen in Lee, and the reason it works is our domain isn’t star shaped any longer if you remove origin from plane. Because then the line connecting $(1,1),(-1,-1)$ is not fully inside $\Bbb{R}^2\setminus\{(0,0)\}$.