In the introductory section of Milnor's Morse Theory, he gives an example of the torus.
The set of points of the torus which have height less than $a$ for some $p<a<q$ is just a solid disk, i.e., a 2-cell. When we move from $q$ to $r$, we start getting a cylinder. Milnor notes that moving from a 2-cell to a cylinder is the same (homotopically) as attaching a 1-cell:
I can sort of understand why: A cylinder can be squashed into a circle, and the bottom half of the left side is homotopically a point, so both sides are homotopically the same as a circle.
But at the same time, moving from $q$ to $r$ means attaching something which looks kind of like the pair of pants:
We can squash the legs together to get a circle, so doesn't this mean that we are attaching a circle to our disk, instead of just a line?



A pair of pants doesn't have the same homotopy type as a circle. You can flatten it and then contract it to the shape of the digit
In any case, who says that the cancellation law holds when gluing topological spaces together? You know that
$$\text{disk} + \text{pair of pants} \approx \text{disk} + \text{line.}$$
Why should you expect that
$$\text{pair of pants} \approx \text{line?}$$
8, i.e. two circles glued at a point.