Help determining TV diode and/or capacitor for protection

I’m making a powerful handheld fan. I just learned the hard way that when you turn it off quickly, the motor briefly becomes a generator that can fry the power supply.
From what I can tell, there are 2 main ways I can protect against this: a capacitor or a TV diode.
How do I figure out the specs of the ones I need?
Are there any other ways to protect against this that I’m missing?

I’m using this brushless EDF fan.
I’m powering it with a USB C power bank using 5A at 20V.