* Storing electrical energy: This is usually done by devices called batteries or capacitors.
* Producing electrical energy: This involves generators that convert mechanical energy into electrical energy or power plants that convert other forms of energy (like fossil fuels, nuclear power, solar, etc.) into electrical energy.
So, while a single device doesn't do both, you could have a system where a generator produces electrical energy and a battery stores it, like in a hybrid car.