Dehn surgery along a knot is a well-known construction: choose a regular neighbourhood $N(K)$ of a knot $K \subset S^3$, let $X_K := S^3 - N(K)$ and choose an essential simple closed curve $\alpha$ on the torus $\partial X_K$.
Then surgery along $K$ is the pushout $X_K \cup_\varphi S^1 \times D^2$. In the literature it is common to find that the attaching map $\varphi : S^1 \times \partial D^2 \to \partial X_K$ is completely determined by mapping the meridian $* \times \partial D^2$ to $\alpha$. How to make precise that such assignment extends to the required map $\varphi$?
One way to see that the image of the meridian determines how to attach the entire torus is by first gluing in a thickened disk, then a 3-ball (which gives the entire torus).
More precisely, first attach a $D^2 \times I$ to $X_K$ via a homeomorphism $f: (\partial D^2 \times I) \to N(\alpha)$, where $N(\alpha)$ is a regular neighborhood of $\alpha$ in $\partial X_K$. This step is just identifying two cylinders.
We then have a 3-manifold $X_K \cup_f (D^2 \times I)$ which has an $S^2$ boundary. Attaching a $D^3$ via a homeomorphism of the $S^2$ boundaries gives a closed 3-manifold.
Here the $D^3$ and the $D^2 \times I$ combined form the total $S^1 \times D^2$ you are gluing in.
As a final note, the resulting 3-manifold does not depend (up to homeomorphism) on the choices of homeomorphisms for gluing, for example since the mapping class groups of $S^1$ and $S^2$ are trivial. See also this question.