We show a purely electronic cooling scheme to cool a charged mechanical resonator (MR) down to nearly the vibrational ground state by elaborately tuning bias gate voltages on the electrodes, which couple the MR by the Coulomb interaction. The key step is the modification of the time-dependent effective eigen-frequency of the MR based on the Lewis–Riesenfeld invariant. With respect to a relevant idea proposed previously (Li et al 2011 Phys. Rev. A 83 043803), our scheme is simpler, more practical and completely within the reach of current technology.