Yes, energy is required to separate the charges. Mostly, the inner of the cell membrane is negatively charged compared to the outside. When the cell becomes depolarized, ions, especially, Sodium ions, are pumped out by active transportation to restore resting potential. Active transport requires energy from ATP powered by food metabolism.