I learned in my algebraic topolgy course that $X$ is a CW complex if there is a filtration $$ \emptyset = X_{-1} \subset X_0\subset \dots\subset X_n \subset \dots \subset X $$
such that $X$ is the union of all $X_n$, the topololgy on $X$ coincides with the topology of the filtration and for all $n$, $X_n$ is the push out of the diagram $\sqcup S^{n-1} \to X^n$ and down $\sqcup D^n$. (sorry at the moment I dont know how to make commutative diagrams in Latex). In other words: $X_n = X_{n-1} \sqcup D^n $ where points in $S^n$ are glued to the image in $X_{n-1}$.
Now I'm lacking a bit of examples. We did in class some examples where the professor did everything geometrically i.e saying a circel is aquivalent to take 2 points and two 2 cells. Which is clear intuitvly but doesnt match with tat formal definition I have above. I would like to have some examples worked out really rigoursly. Does anyone has a got reference for that?
Another qustion. My professor said that a simplicial complex i.e a collection of simplicies such that, any intersection is inside and every faces are inside, is also a CW structure. How does this work?
The notion you are referring to is that of a geometric (or Euclidean) simplicial complex. The definitions may slightly vary across the literature, so here's the one I think is best. First, the set-up:
Fix some Euclidean space $\mathbb{R}^N$. An $n$-simplex $\sigma^n\subseteq\mathbb{R}^N$ is the convex hull of $n+1$ affinely independent points. These points are uniquely determined by $\sigma^n$ (they are its extreme points) and called its vertices. In particular, the number $n$ is uniquely determined and called the dimension of this simplex. The convex hull of any subset of the vertices of an $n$-simplex $\sigma^n$ yields a $k$-simplex $\tau^k$ for some $k\le n$ that is called a face of $\sigma^n$. Every face of $\sigma^n$ that is not $\sigma^n$ itself is called a proper face and has strictly smaller dimension; the union of these proper faces is denoted $\partial\sigma^n$. Note that there is an affine linear injection $\mathbb{R}^{n+1}\hookrightarrow\mathbb{R}^N$ that maps the standard $n$-simplex $\Delta^n=\{(x_0,\dotsc,x_n)\in[0,1]^{n+1}\vert\sum_{i=0}^nx_i=1\}$ homeomorphically onto $\sigma^n$. In particular, $n\le N-1$. Note also that $\sigma^n$ is necessarily closed (compact even).
Now, a geometric simplicial complex is a family $K$ of simplices in $\mathbb{R}^N$ s.t. (1) a simplex in $K$ also has any of its faces in $K$, (2) two simplices in $K$ are either disjoint or intersect of a common face and (3) the collection is locally finite. The underlying space of the geometric simplicial complex is $X=|K|=\bigcup K$, the union of its simplices. There are plenty of low-dimensional examples that can be visualized. I recommend drawing some pictures demonstrating that any polygon or polyhedron can be represented as the underlying space of a geometric simplicial complex by subdividing it into $2$-simplices.
The idea of how to turn a geometric simplicial complex into a CW-complex is fairly intuitive. The $0$-simplices are a set of points, which we take to be the $0$-skeleton. Each $1$-simplex is a line segment joining two $0$-simplices, so we take the $1$-skeleton to be the union of all $0$- and $1$-simplices. Each $2$-simplex is a solid triangle whose edges are $1$-simplices, so we take the $2$-skeleton to be the union of all $0$-, $1$- and $2$-simplices, etc..
Explicitly, given $i=0,\dotsc,N-1$, let $K^i$ be the geometric simplicial complex consisting of all simplices of $K$ that have dimension $\le i$ (exercise: this is actually a geometric simplicial complex) and let $X_i=|K^i|$. This gives an increasing filtration $X_0\subseteq X_1\subseteq\dotsc\subseteq X_{N-1}=X$. In the $i$-th step, the space $X_i$ is, by definition, the union of $X_{i-1}$ and all $i$-simplices $\sigma^i\in K^i\setminus K^{i-1}$. The axiom (1) implies that $\partial\sigma^i\subseteq X_{i-1}$ and axiom (2) implies that $\sigma^i\cap X_{i-1}\subseteq\partial\sigma^i$, so we obtain that $\sigma^i\cap X_{i-1}=\partial\sigma^i$. Furthermore, axiom (2) implies that $\sigma^i\cap\tau^i\subseteq X_{i-1}$ if $\sigma^i,\tau^i$ are distinct $i$-simplices. Thus, we obtain a diagram $$\require{AMScd} \begin{CD} \coprod_{\sigma^i\in K^i\setminus K^{i-1}}\partial\sigma^i @>>> X_{i-1}\\ @VVV @VVV\\ \coprod_{\sigma^i\in K^i\setminus K^{i-1}}\sigma^i @>>> X_i \end{CD}.$$ The previous argument implies precisely that this is a pushout argument on the level of sets. To recognize this as a pushout diagram of topological spaces, it thus remains to argue that a function $f\colon X_i\rightarrow T$ into some topological space $T$ is continuous iff the restrictions $f\vert_{X_{i-1}}$ and $f\vert_{\sigma^i}$ for all $\sigma^i\in K^i\setminus K^{i-1}$ are continuous. This is the case as axiom (3) ensures us that this is a locally finite collection of closed subspaces of $X_i$. Now, you may choose homeomorphisms $D^i\stackrel{\sim}{\rightarrow}\sigma^i$ that (necessarily) identify $S^{i-1}\stackrel{\sim}{\rightarrow}\partial\sigma^i$ to obtain the desired pushout diagram $$\require{AMScd} \begin{CD} \coprod_{\sigma^i\in K^i\setminus K^{i-1}}S^{i-1} @>>> X_{i-1}\\ @VVV @VVV\\ \coprod_{\sigma^i\in K^i\setminus K^{i-1}}D^i @>>> X_i \end{CD}.$$ This proves the desired CW-structure.
Note that many spaces are not themselves the underlying spaces of geometric simplicial complexes, but oftentimes homeomorphic thereto. E.g. the sphere $S^1$ is not any such underlying space (simplices are convex and $S^1$ does not contain any convex subspace with more than one point), but it is homeomorphic to $\partial\Delta^2$, a triangle, which can be realized as the underlying space of the geometric simplicial complex consisting of your favorite $3$ points in the plane as $0$-simplices and the $3$ line segments connecting them as $1$-simplices. There are also CW-structures on $S^1$ with $2$ $0$-cells and $2$ $1$-cells as well as $1$ $0$-cell and $1$ $1$-cell, but these do not arise from geometric simplicial complexes in this way.