It really depends of the problem.

For example, you have an integral, and any sub. you tried didn't work out, then from there think to make an integration by parts. Not always works, it depends of your integration skills and practice.

The key of the integration by parts (or partial integration) is to get a remaining integral on the RHS so that we can easily tackle it, or may be apply partial integration again to see what we can find.