The fastest way: open the bottle slowly. Turn the cap just enough that the bottle starts hissing. This will release the pressure without spraying foam all over.
Once the pressure has been relieved, you can open the bottle normally.
(this is much easier with screwtop bottles than with cans, as the screw top allows fine control)
Turn it upside down
Turn the bottle upside down, keep it there for maybe 20 seconds, then slowly turn it right side up, and open. This is an old waiter's trick for use with accidentally-shaken champagne bottles... I assume it will work for soda too.
Swap it for one still in the fridge, and walk away.
There is no way to "calm down" a soda quickly after it's been shaken; it'll take a minimum of an hour or so sitting quietly in refrigeration of the carbon dioxide to redissolve and the pressure inside the bottle or can return to its normal value.
The closest I've ever been able to come is to open ...