Define operations of cutting and pasting in topology, formally. In topology a lot of arguments require to cut a manifold along a non-trivial closed simple curve, which gives other manifolds, and pasting manifolds along their boundaries.
How are those operations defined in a more formal way, for example given a manifold $M$ then $$M=A *_C B $$ for some manifolds $A$ and $B$, is the cutting of $M$ along the curve $C$ which gives $A$ and $B$, what is the operation $*_C$?
Similarly for pasting given two manifolds $A'$,$B'$ with boundaries $C_1,C_2$ respectively, then $$A' *_{C_1 \sim C_2}'B'=M'$$ is the identification of their boundaries, what is the operation $*_{C_1 \sim C_2}$ ?
 A: First of all, you should decide what you mean by a "manifold:" There are topological manifolds, PL (piecewise-linear) manifolds, differentiable manifolds. All these have slightly different notions of "cut-and-paste" operations. I will restrict to "topological manifolds."
If $C$ is a Jordan curve in a surface $M$, one of two things will happen:
(a) $C$ is 2-sided.
(b) $C$ is 1-sided.
The former means that $C$ has a closed "product neighborhood" in $S$, which is a compact subset $N(C)$ in $M$ homeomorphic to the annulus $S^1\times [-1,1]$ such that the homeomorphism sends $C$ to the circle $S^1\times \{0\}$.
In the latter case, $N(C)$ is a Moebius band and $C$ corresponds to the "core curve" of the band.
The fact that each Jordan curve is either of type (a) or type (b) is a nontrivial result (a form of Schoenflies theorem). A similar result fails (in general) for hypersurfaces $S$ in manifolds $M$ of dimension $\ge 3$, but holds under an extra condition, called tameness of $S$. (Personally, I prefer to think of tameness as a part of the definition of a topological submanifold, but I am a minority here.) Under this condition, $N(C)$ is again either the product $S\times [-1,1]$ or is the total space of a nontrivial interval bundle over $S$, which is a higher-dimensional analogue of the Moebius band (there are, typically, infinitely many interval bundles).
Now, the operation of "cutting $M$ along $C$" means removing from $M$ the interior of $N(C)$. The result is a surface with one or two boundary curves. It is sometimes denoted $M\backslash \! \backslash C$.
Now, to the converse: Suppose that $M_1, M_2$ are two surfaces with boundary and $C_i\subset \partial M_i$ are boundary components which are closed (Jordan) curves. Pick a homeomorphism $f: C_1\to C_2$: Up to isotopy there are exactly two such maps. If one thinks of $C_2$ as the unit circle in the complex plane, then one obtains the second map $\bar{f}$ from the first one by complex conjugation.
Then one defines the adjunction space
$$
X_f=M_1\cup_f M_2.
$$
Informally, you glue $M_1, M_2$ via $f$. The formal definition is that you first take the disjoint union $X=M_1\sqcup M_2$ and then introduce an equivalence relation on  $X$ by: $x\sim f(x), x\in C_1$. (For the points $x\notin C_1\sqcup C_2$ the equivalence class of $x$ consists only of the point $x$.) Lastly, form the quotient space $X_f:=X/\sim$ with the quotient topology.
It turns out that (in the case of surfaces) the homeomorphism class of $X_f$ is independent of the choice of $f$. A similar construction works if $M=M_1=M_2$ and $C_1, C_2$ are (possibly equal) boundary components of $M$. In the case when $C_1=C_2$ one adds the extra requirement that $f(x)\ne x$ for all $x\in C_1$.
Then, in general, $X_f$ depends on the isotopy class of $f$ and, up to a homeomorphism, there are at most two surfaces obtained this way. The space $X_f$ is always a (topological) manifold, possibly with boundary, and $\partial X_f$ is the image of $\partial X - (C_1\cup C_2)$ under the quotient map.
The pasting construction also works in higher dimensions, but, now, there could be more than two isotopy classes of homeomorphisms and, accordingly, more than two homeomorphism classes of manifolds $X_f$.
