This textbook says that it is well known that the Isotopy classes of essential simple closed curves in a 4-punctured sphere can be identified to $\mathbb{Q}\cup\{\infty \}$. I tried to find some textbooks/pdf on google that I can find explanations to that, but I couldn't.
Can anyone explain that to me? From here, I understand the case of the Torus but the case of the 4-punctured sphere looks mysterious to me.
(You likely mean curves that separate the four points into two sets of two points, which is the case I'll answer here.)
Fix a sphere $S$ with four distinct points $x_1,x_2,x_3,x_4\in S$. Also, choose two non-intersecting oriented simple arcs $x_1$ to $x_2$ and $x_3$ to $x_4$. If you slice along these two arcs you get a cylinder whose boundaries can be labeled with the four points and two copies each of the two arcs.
Take two copies of this cylinder and glue them together in a way that respects the orientations of the arcs, the orientations of the surfaces, and the point labels.
This defines a cover of the four-times punctured sphere by the 4-times punctured torus. In fact, it's a double branched cover with the four points being the branch loci. The blue arcs lift to meridians, and if we consider the arcs as being on an equator of the sphere, the lifts of the parts of the equator in the complement of the arcs form longitudes (both by fiat). When oriented in some way, these give the homological coordinate system for the torus, which we need to actually pin down curves as elements of $\mathbb{Q}\cup\{\infty\}$.
Given a simple closed curve in the complement of the four points in the sphere, lift the curve up to the torus, and choose one of the two lifts.
Isotopies of the curve in the sphere lift to isotopies of the curve in the torus. This means that the slope of the lift is an invariant (so if two curves in the four-times punctured sphere lift to curves of different slopes, they are not isotopic). Every slope is possible, since for a given slope, shift a standard parameterization of a curve with that slope a little so it doesn't intersect the four points, and then the image down on the sphere is a simple closed curve.
What remains is why if two curves lift to curves with the same slopes then they are isotopic on the sphere. Let's make sure we start out with a curve in a nice form. Assume it intersects the blue arcs transversely first of all. What we can do is make sure that the curve never intersects the same blue arc twice in a row; that is, it intersects one, then the other, then the first, etc. This is because if it intersects the same one twice and forms a digon, the innermost such digon can be used to isotope the curve across the arc. And, if it intersects the arc twice from the same side, by winding number considerations it'll have to backtrack and thus form a digon. These two cases are illustrated in the following picture.
So, in the cylinder point of view (from when we slice open the blue arcs), we get either a single essential loop, or we get a collection of parallel green arcs that connect the two boundary components. In the lift, the corresponding simple closed curve is isotopic to a standard slope without having to cross any of the four points. That's it for completeness of the invariant.
By the way, the green curve is the boundary of the compression disk that book you link to mentions. If you give the torus a Euclidean metric, it is natural to think of the sphere as being a flat pillowcase. The corners add up to 180 degrees, which is what you would expect from a double branched cover.
There are also more algebraic approaches involving rational tangles, for instance https://arxiv.org/abs/math/0311511
Another approach is to think of a four-times punctured sphere as a three-times punctured disk. The mapping class group of the the 3-times punctured disk, holding the boundary fixed, is the braid group on three strands. This is realized by isotoping the three punctures around each other, where the points through time trace out a braid. In the following picture, $a$ and $b$ are the generating swaps. The group also acts on simple closed curves by letting them follow along for the ride.
Notice that the case when a simple closed curve contains one or three of the points is uninteresting. One of the sides is a disk with one point, and it follows that there are four such possible simple closed curves. So, we proceed with the case that the curve contains exactly two points.
That curve bounds a disk, and since every disk is isotopic to every other disk, there is some ambient isotopy that carries this particular curve to the standard green curve as pictured in the image above. Furthermore, we can isotope the three points to where they are supposed to be, and so there is an element of the mapping class group realizing this transformation. In particular, there is some braid element that gives this particular simple closed curve (in the picture, the third curve is given by $b^{-1}a$).
(One way to proceed is to go back to the torus and realize $a$ and $b$ on the torus as Dehn twists.)
Let $c_0,\dots,c_{2k}\in\mathbb{Z}$ be such that $a^{c_0}b^{-c_1}a^{c_2}\cdots a^{c_{2k}}$ is a braid element that gets the simple closed curve. There are no $b$'s at the end because they act trivially on the standard green curve. It turns out that the continued fraction $$[c_0;c_1,c_2,\dots,c_{2k}]=c_0+\frac{1}{c_1+\frac{1}{c_2+\cdots+\frac{1}{c_{2k}}}}$$ (as an element of $\mathbb{Q}\cup\{\infty\}$) is a complete invariant for the simple closed curve. (I won't prove this here, but it comes down to using the Euclidean algorithm to get a standard form for a continued fraction.)