The best way...well it's to have good genetics so it never happens in the first place.

But the 2nd best way to fix this, if possible, is to improve your body so that it can hold itself upright more easily (core strength and some other stuff).
I started doing Limber 11 for a non-biking injury, and it really improved my comfort level on my bike:
Limber 11 Flexibility Routine | stretching-exercises.com
Not saying it would work for everyone, but it helped for me.
Other thoughts:
- As others mentioned better grips on the bars can help
- Sometimes a better bike fit can improve things, a slightly longer or shorter stem sometimes moves you into a position your body is much better at holding without pressure on your wrists
- I found that a smaller keyboard at work lets my mouse arm sit more naturally and is a lot more comfortable. Here's one specific suggestion:
https://www.amazon.com/dp/B00F3U4TQS/
- Similarly I believe that a better chair would help as well, though it's been a pain finding one.
- Road bars can help because they put pressure on your hands differently. With flat bars your hands twist horizontally, with road bars your hands stay vertical like they do when they rest at your side while standing. Here's a pic of how one typically rides with road bars: