We present a new approach, inspired by Stein's method, to prove a central limit theorem (CLT) for linear statistics of βensembles in the one-cut regime. Compared with the previous proofs, our result requires less regularity on the potential and provides a rate of convergence in the quadratic Kantorovich or Wasserstein-2 distance. The rate depends both on the regularity of the potential and the test functions, and we prove that it is optimal in the case of the Gaussian Unitary Ensemble (GUE) for certain polynomial test functions.The method relies on a general normal approximation result of independent interest which is valid for a large class of Gibbs-type distributions. In the context of β-ensembles, this leads to a multidimensional CLT for a sequence of linear statistics which are approximate eigenfunctions of the infinitesimal generator of Dyson Brownian motion once the various error terms are controlled using the rigidity results of Bourgade, Erdős and Yau.