To do this you need a weapon set that gives you energy, such as a staff with +10 energy or a set with a focus that gives +12 energy. It is also highly recommended to have another melee weapon with -5 energy, in addition to a focus such as the Forgotten Fan, Frozen Fan or Tattered Fan, each which net you -2 energy if you don't meet the requirements.
If you are at 10 energy while wielding a staff and you are hit with Debilitating Shot, then you lose 10 energy, and that energy is gone forever. But if you are at 10 energy when you switch to your empty set, you "lose" that 10 energy and are down to 0 energy. So when you are hit with Debilitating Shot it takes away no energy because you don't have any at that time. After that you can switch back to your staff and you instantly have an extra 10 energy.