How do I know what to pick in A-Level Maths? To the question above, thanks.
It may come down looking ahead (quick/rough working) for a couple of steps for both and seeing if either gives. If so, thats the one to work out more carefully.
But an integration by parts will have some form of product of two functions, even if one is the trivial function "1" (if the other involves ln(x)). Similarly, you may be asked to get a recursive relationship (by parts) if the integrand involves trig/exponential functions. A substitution can involve a product as well (reverse chain) but often its close to being a simple integration problem if it wasnt for a square root or ... Similarly looking at the limits may give a hint about whether it will be a substitution. The integration cheat sheet https://www.drfrostmaths.com/uploads/JFrost/files/C4CheatSheet.pdf is useful, but the boring advice is to do questions and reflect on what hint there is in the original question about how to proceed.