I would like to add a bit of commentary to LittleO's post. As someone who just recently learned the 'formal' approach to single variable integration (Spivak's Calculus), I would first tell all beginners to familiarize themselves with the implicit, shorthand notations that riddle discussions of integration: e.g. $\int_a^b f \iff \int_a^b f(x)dx \iff \int_a^b f(t)dt$
Suppose we are interested in finding the antiderivative/primitive of a function $h$...which is what is implicitly being asked when tasked to compute "$\int h$"...note the absence of explicit limits of integration...i.e. $\int_a^b h(x) dx$ is semantically distinct from $\int h$.
It may be the case that $h$ is a complicated function, so it is not immediately clear how we can find an $H$ such that $H'=h$. However, there is a trick that can occasionally work, which is derived from the following theorem:
If $f$ and $g'$ are continuous functions, then$\displaystyle \int_{g(a)}^{g(b)}f(u)du=\int_a^b[f\circ g](x)\cdot g'(x)dx $
The reason this comes in handy is that if it turns out that we can find an $f$ and $g$ such that $h=f \circ g \cdot g'$...AND if it turns out that $\int f$ belongs to a collection of 'easy-to-compute' / already-known-primitives, then we can apply the above theorem to deduce what $\int h$ is. Specifically, because we know that $\int f = F$, using the aforementioned theorem and the Fundamental Theorem of Calculus, we will have that $\int h = \int f \circ g \cdot g'=F\circ g \quad (\dagger)$, as LittleO specified...people will sometimes include the arbitrary constant $C$, but you do not have to.
So how exactly does $u$-substitution come into play here? The purpose of $u$-substitution is to help us deduce what exactly $f$ and $g$ are so that we can apply $(\dagger)$. From my experience, there are effectively two different flavors of the $u$-substitution approach, one of which is more straightforward than the other.
Method 1
This is the most straightforward $u$-substitution approach and it can be used to tackle primitive searches such as $\displaystyle \int\sin^3(x)\cos(x)dx$. For this integral, someone's work will likely look like this:
\begin{align}u&=\sin(x) \\ du&=\cos(x)dx \\\int u^3du &=\frac{u^4}{4}\\ \text{plugging} &\text{ in $\sin(x)$ for $u$}\\ \int\sin^3(x)\cos(x)dx&=\frac{\sin^4(x)}{4} \end{align}
So what exactly is going on here? Firstly, several of the equality symbols used here are extremely misleading. Such equality symbols do not really mean equality (at least not in the usual sense). I prefer to write the following:
\begin{align}u&\overset{*}=\sin(x) \\ du&\overset{*}=\cos(x)dx \\\int u^3du &=\frac{u^4}{4}\\ \text{plugging} &\text{ in $\sin(x)$ for $u$}\\ \int\sin^3(x)\cos(x)dx&=\frac{\sin^4(x)}{4} \end{align}
You will notice that I used a new symbol $\overset{*}=$. I am defining this symbol to mean "Replace the text on the right with the text on the left". In the context of our integral $\displaystyle \int\sin^3(x)\cos(x)dx$, these two replacement operations (one for $\cos dx$ and one for $\sin$) yield the integral $\displaystyle \int u^3du$.
So why does this work, exactly? Well, starting from $\displaystyle \int u^3 du$, let's work backwards and perform the following (remember that our symbol $\overset{*}=$ has a particular order for the text swap): $g(x)\overset{*}= u$ and $g'(x)dx\overset{*}=du$. Then we have $\displaystyle \int g(x)^3 g'(x) dx$. This looks an awful lot like our desired form $\displaystyle \int [f \circ g](x) \cdot g'(x) dx$. In fact, you should realize that this structures reveals what our $f$ function is: $f(\star)=(\star)^3$...i.e. $[f\circ g](x) \cdot g'(x)=f(g(x))\cdot g'(x)=g(x)^3 g'(x)$. Now that we have our function $f$, and it happens to be easy to integrate, we apply our $(\dagger)$ to get the appropriate answer.
Method 2
The next method can be used to evaluate integrals such as $\displaystyle \int \sqrt{1-x^2}dx$. Recalling some standard trig formulas (double angle theorem and such), someone's work will most likely look like:
\begin{align} x&=\sin(u) \\dx &= \cos(u)du \\ \int\sqrt{1-\sin^2(u)}\cos(u)du=\int \cos^2(u)du&=\int \frac{1+\cos(2u)}{2}=\frac{1}{2}u+\frac{\sin(2u)}{4}=\frac{1}{2}u+\frac{\sin(u)\cos(u)}{2}\\\text{plugging in } &\arcsin(x) \text{ for $u$} \\\int \sqrt{1-x^2}dx&=\frac{\arcsin(x)}{2}+\frac{x\sqrt{1-x^2}}{2}\end{align}
The structure is seemingly different from Method 1, where we now are involving functions of $u$ (rather than functions of $x$, as we did with Method 1). So why does this work at all?
First, consider the following argument.
Suppose $h(x)=[f \circ g](x) \cdot g'(x)$ and we know that $g$ has an inverse $g^{-1}$. There is a calculus theorem that tells us that $[g^{-1}]'(u)=\frac{1}{g'(g^{-1}(u))}$. We will keep this in our back pocket for the moment. Next, consider the composition $h(g^{-1}(u))$. Then we have that: \begin{align}h(g^{-1}(u))&=[f \circ g](g^{-1}(u))\cdot g'(g^{-1}(u)) \\&=f(u)\cdot g'(g^{-1}(u)) \end{align}
Next, let us multiply both sides by $[g^{-1}]'(u)$ and apply our pocketed theorem:
\begin{align}h(g^{-1}(u))\cdot [g^{-1}]'(u)&=f(u)\cdot g'(g^{-1}(u)) \cdot[g^{-1}]'(u)\\&= f(u)\cdot g'(g^{-1}(u)) \cdot \frac{1}{g'(g^{-1}(u))} \\&=f(u)\end{align}
Although this derivation may seem unrelated, note that we have figured out a way of manipulating $h$ such that the function $f$ is revealed to us. But this derivation is precisely what our $u$-substitution strategy is attempting to mimic (although in a shorthand manner)!
If we define $g=\arcsin$, then $g^{-1}=\sin$ (albeit, with a restricted domain). Letting $h(x)=\sqrt{1-x^2}$, we then composed $h$ with $g^{-1}$ when we wrote "$x=\sin(u)$"...i.e. $h(\sin(u))=\sqrt{1-\sin^2(u)}$. What did we do next? Well, when we wrote "$du=\cos(x)dx$", all we really did was multiply $\sqrt{1-\sin^2(u)}$ by $\cos(u)$, which is the derivative of $\sin(u)$. i.e. we multiplied $h(g^{-1}(u))$ by $[g^{-1}]'$, which gives us the function $\sqrt{1-\sin^2(u)}\cdot \cos(u)$. From our above derivation, we thus conclude that $f(u)=\sqrt{1-\sin^2(u)}\cdot \cos(u)$. So, really, once again, all the $u$-substitution approach is doing is revealing the function $f$ to us (which is, hopefully, something that is comparatively easier to integrate). In accordance with $(\dagger)$, after integrating this $f$, we just need to plug in $g$ as its argument to get the appropriate answer.