Use a resistor because that is simple.
W=V*I simple but really -V does not get you -W. W=|V*I| Absolute is | |. New keyboard and can not find the symbols I want. lol
Capacitors and inductors act different at AC verses DC. You can put 10V on a cap and it does not heat up. (OK maybe there is 1uA of leakage that will cause heating) For a capacitor, while you are changing the voltage from one level to another, current flows. That current and the "internal series resistance" causes heating. It does not matter if the current is flowing in or out. (absolute value)
Incuctors are fare more complicated. For the first order simple example; current * resistance. (absolute value!) Voltage does not matter. (OK voltage across the internal resistance does matter)