We looked at integral problems using u-substitution. For a few problems, the u expression was provided. In that case you take du/dx (or with respect to another variable) and substitute back in to make a simpler integral.
Later, for other problems you choose the expression for u and that sometimes is a bit of trial and error. The basic idea is to choose something that when you take the derivative, gives you something that was in original integral that you can substitute for.
For example, the derivative of sinx will be cosx. But also even though the derivative of cosx is -sinx, that can be easily moved around an expression with a small modification.