I have never figured out how, and nothing at the gym works.
There's a number of exercises, but they all boil down to clenching your fists. Clench just as hard as you can.
To develop wrist as well as fist, hold a dumbbell (or better a heavy steel rod) in your hand and bend your wrist in all four directions.
There are a number of exercises you can do to build forearm strength. Gripping type movements work well to develop your wrists and forearms. At the gym you can use dumbbells to do wrist curls and reverse wrist curls.
take a bath towel, roll it tightly- with both hands as if you could squeeze water out of it.
Do that for 5 minutes every night.
When that gets too easy- buy a few feet of very thick rope and do the same thing.
Work with weapons.
Doing "wrist curl" movements isometrically will build strength relatively quickly.
You can also hang from a bar for time, adding endurance to your strength.