Convergence and variance reduction for stochastic differential equations in sampling and optimisation