The effective lifetime of the B0s meson in the decay B0s → J/ψK0S is measured using data collected during 2016–2018 with the CMS detector in √s = 13 TeV proton-proton collisions at the LHC, corresponding to an integrated luminosity of 140 fb−1. The effective lifetime is determined by performing a two-dimensional unbinned maximum likelihood fit to the B0s meson invariant mass and proper decay time distributions. The resulting value of 1.59 ± 0.07(stat) ± 0.03(syst) ps is the most precise measurement to date and is in good agreement with the expected value.