As a rule of thumb, it is best to apply a logarithmic derivative to a product.
For instance, if we start with the Weierstrass product for the $\Gamma$ function $$ \Gamma(z+1) = e^{-\gamma z}\prod_{n\geq 1}\left(1+\frac{z}{n}\right)^{-1}e^{z/n}\tag{1} $$ we instantly get: $$ \psi(z+1) = -\gamma+\sum_{n\geq 1}\left(\frac{1}{n}-\frac{1}{z+n}\right) = \sum_{n\geq 1}\left[\log(n+1)-\log(n)+\frac{1}{n+z}\right]\tag{2} $$ and by the inverse Laplace transform and Frullani's theorem we have $$ \log(n+1)-\log(n) = \int_{0}^{+\infty}\frac{e^{-nt}-e^{-(n+1)t}}{t}\,dt,\qquad \frac{1}{n+z} = \int_{0}^{+\infty} e^{-(n+z)t}\,dt \tag{3}$$ hence by plugging these integral representations into $(2)$ and summing over $n$ we recover the integral representation shown above.